kgoldrunner
kgrobject.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KGROBJECT_H
00019 #define KGROBJECT_H
00020
00021
00022 #include <iostream>
00023
00024 #include <QTimer>
00025 #include <stdlib.h>
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
00037 static bool frozen;
00038 static bool bugFixed;
00039 static bool logging;
00040
00041 char whatIam();
00042 int searchValue;
00043 bool blocker;
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;
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;
00083 static int HOLETIME;
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
00102 KGrHladder (char objType, int i, int j, KGrCanvas * view);
00103 virtual ~KGrHladder();
00104 void showLadder();
00105 };
00106
00107 #endif // KGROBJECT_H