]> Shamusworld >> Repos - architektonas/blob - src/object.h
Major refactor of Architektonas: Jettisoning old cruft.
[architektonas] / src / object.h
1 #ifndef __OBJECT_H__
2 #define __OBJECT_H__
3
4 #include "vector.h"
5
6 class QPainter;
7 class QFont;
8
9 enum ObjectState { OSInactive, OSSelected };
10
11 class Object
12 {
13         public:
14                 Object();
15                 Object(Vector, Object * passedInParent = 0);
16                 ~Object();
17
18                 virtual void Draw(QPainter *);
19                 virtual Vector Center(void);
20                 virtual bool Collided(Vector);
21                 virtual void PointerMoved(Vector);
22                 virtual void PointerReleased(void);
23                 virtual bool NeedsUpdate(void);
24
25                 ObjectState GetState(void);
26
27                 // Class methods
28                 static void SetFixedAngle(bool state = true);
29                 static void SetFixedLength(bool state = true);
30                 static void SetFont(QFont *);
31                 static void SetViewportHeight(int);
32
33         protected:
34                 Vector position;                                        // All objects have a position (doubles as reference point)
35                 Object * parent;
36 //              Pen pen;
37 //              Fill fill;
38                 ObjectState state;
39                 ObjectState oldState;
40                 bool needUpdate;
41
42                 // Class variables
43                 static QFont * font;
44                 static bool fixedAngle;
45                 static bool fixedLength;
46                 static int viewportHeight;
47 };
48
49 #endif  // __OBJECT_H__