diff options
Diffstat (limited to 'src/components/transformable.h')
| -rw-r--r-- | src/components/transformable.h | 69 |
1 files changed, 69 insertions, 0 deletions
| diff --git a/src/components/transformable.h b/src/components/transformable.h new file mode 100644 index 0000000..6ed2637 --- /dev/null +++ b/src/components/transformable.h | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | #ifndef LOCATABLE_H_39E526CA | ||
| 2 | #define LOCATABLE_H_39E526CA | ||
| 3 | |||
| 4 | #include "component.h" | ||
| 5 | |||
| 6 | class TransformableComponent : public Component { | ||
| 7 | public: | ||
| 8 | |||
| 9 | TransformableComponent( | ||
| 10 | double x, | ||
| 11 | double y, | ||
| 12 | int w, | ||
| 13 | int h) : | ||
| 14 | x_(x), | ||
| 15 | y_(y), | ||
| 16 | w_(w), | ||
| 17 | h_(h) | ||
| 18 | { | ||
| 19 | } | ||
| 20 | |||
| 21 | inline double getX() const | ||
| 22 | { | ||
| 23 | return x_; | ||
| 24 | } | ||
| 25 | |||
| 26 | inline void setX(double v) | ||
| 27 | { | ||
| 28 | x_ = v; | ||
| 29 | } | ||
| 30 | |||
| 31 | inline double getY() const | ||
| 32 | { | ||
| 33 | return y_; | ||
| 34 | } | ||
| 35 | |||
| 36 | inline void setY(double v) | ||
| 37 | { | ||
| 38 | y_ = v; | ||
| 39 | } | ||
| 40 | |||
| 41 | inline int getW() const | ||
| 42 | { | ||
| 43 | return w_; | ||
| 44 | } | ||
| 45 | |||
| 46 | inline void setW(int v) | ||
| 47 | { | ||
| 48 | w_ = v; | ||
| 49 | } | ||
| 50 | |||
| 51 | inline int getH() const | ||
| 52 | { | ||
| 53 | return h_; | ||
| 54 | } | ||
| 55 | |||
| 56 | inline void setH(int v) | ||
| 57 | { | ||
| 58 | h_ = v; | ||
| 59 | } | ||
| 60 | |||
| 61 | private: | ||
| 62 | |||
| 63 | double x_; | ||
| 64 | double y_; | ||
| 65 | int w_; | ||
| 66 | int h_; | ||
| 67 | }; | ||
| 68 | |||
| 69 | #endif /* end of include guard: LOCATABLE_H_39E526CA */ | ||
