diff options
Diffstat (limited to 'src/components/transformable.h')
| -rw-r--r-- | src/components/transformable.h | 78 |
1 files changed, 60 insertions, 18 deletions
| diff --git a/src/components/transformable.h b/src/components/transformable.h index 69f4f0e..6ed2637 100644 --- a/src/components/transformable.h +++ b/src/components/transformable.h | |||
| @@ -4,24 +4,66 @@ | |||
| 4 | #include "component.h" | 4 | #include "component.h" |
| 5 | 5 | ||
| 6 | class TransformableComponent : public Component { | 6 | class TransformableComponent : public Component { |
| 7 | public: | 7 | public: |
| 8 | TransformableComponent(double x, double y, int w, int h); | 8 | |
| 9 | 9 | TransformableComponent( | |
| 10 | double getX() const; | 10 | double x, |
| 11 | double getY() const; | 11 | double y, |
| 12 | int getW() const; | 12 | int w, |
| 13 | int getH() const; | 13 | int h) : |
| 14 | 14 | x_(x), | |
| 15 | void setX(double v); | 15 | y_(y), |
| 16 | void setY(double v); | 16 | w_(w), |
| 17 | void setW(int v); | 17 | h_(h) |
| 18 | void setH(int v); | 18 | { |
| 19 | 19 | } | |
| 20 | private: | 20 | |
| 21 | double x; | 21 | inline double getX() const |
| 22 | double y; | 22 | { |
| 23 | int w; | 23 | return x_; |
| 24 | int h; | 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_; | ||
| 25 | }; | 67 | }; |
| 26 | 68 | ||
| 27 | #endif /* end of include guard: LOCATABLE_H_39E526CA */ | 69 | #endif /* end of include guard: LOCATABLE_H_39E526CA */ |
