• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kgoldrunner

kgrobject.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                          kgrobject.h  -  description
00003                              -------------------
00004     begin                : Wed Jan 23 2002
00005     Copyright 2002 Marco Krüger <grisuji@gmx.de>
00006     Copyright 2002 Ian Wadham <ianw2@optusnet.com.au>
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef KGROBJECT_H
00019 #define KGROBJECT_H
00020 
00021 // Obsolete - #include <iostream.h>
00022 #include <iostream>
00023 
00024 #include <QTimer>
00025 #include <stdlib.h> // for random
00026 
00027 class KGrCanvas;
00028 
00029 class KGrObject : public QObject
00030 {
00031   Q_OBJECT
00032 public:
00033   explicit KGrObject (char objType);
00034   virtual ~KGrObject();
00035 
00036   // STATIC GLOBAL FLAGS.
00037   static bool frozen;       // Game play halted (use ESCAPE key).
00038   static bool bugFixed;     // Dynamic bug fix turned on (key B, if halted).
00039   static bool logging;      // Log printing turned on.
00040 
00041   char whatIam();
00042   int searchValue;
00043   bool blocker; // Beton or Brick -> TRUE
00044   void showState (int, int);
00045 
00046 protected:
00047   KGrCanvas * objectView;
00048   int xpos;
00049   int ypos;
00050   char iamA;
00051 };
00052 
00053 class KGrEditable : public KGrObject
00054 {
00055   Q_OBJECT
00056 public:
00057   KGrEditable (char editType);
00058   virtual ~KGrEditable ();
00059   void setType (char);
00060 };
00061 
00062 class KGrFree : public KGrObject
00063 { Q_OBJECT
00064 public:
00065   KGrFree (char objType, int i, int j, KGrCanvas * view);
00066   virtual ~KGrFree();
00067   void setNugget(bool);
00068 
00069 protected:
00070   char theRealMe;   // Set to FREE or HLADDER, even when "iamA == NUGGET".
00071 };
00072 
00073 class KGrBrick : public KGrObject
00074 {
00075   Q_OBJECT
00076 public:
00077   KGrBrick (char objType, int i, int j, KGrCanvas * view);
00078   virtual ~KGrBrick();
00079   void dig(void);
00080   void useHole();
00081   void unUseHole();
00082   static int speed; // Digging & repair speed (copy of KGrFigure::speed).
00083   static int HOLETIME;  // Number of timing cycles for a hole to remain open.
00084   void doStep();
00085   void showState (int, int);
00086 
00087 protected slots:
00088   void timeDone(void);
00089 
00090 private:
00091   int dig_counter;
00092   int hole_counter;
00093   bool holeFrozen;
00094   QTimer *timer;
00095 };
00096 
00097 class KGrHladder : public KGrFree
00098 {
00099   Q_OBJECT
00100 public:
00101   // BUG FIX - Ian W., 21/6/01 - must inherit "setNugget()" from "KGrFree".
00102   KGrHladder (char objType, int i, int j, KGrCanvas * view);
00103   virtual ~KGrHladder();
00104   void showLadder();
00105 };
00106 
00107 #endif // KGROBJECT_H

kgoldrunner

Skip menu "kgoldrunner"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal