diff options
Diffstat (limited to 'src/components/ponderable.h')
-rw-r--r-- | src/components/ponderable.h | 68 |
1 files changed, 53 insertions, 15 deletions
diff --git a/src/components/ponderable.h b/src/components/ponderable.h index c836d2a..80100d7 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h | |||
@@ -4,21 +4,59 @@ | |||
4 | #include "component.h" | 4 | #include "component.h" |
5 | 5 | ||
6 | class PonderableComponent : public Component { | 6 | class PonderableComponent : public Component { |
7 | public: | 7 | public: |
8 | double getVelocityX() const; | 8 | |
9 | void setVelocityX(double v); | 9 | inline double getVelocityX() const |
10 | double getVelocityY() const; | 10 | { |
11 | void setVelocityY(double v); | 11 | return velX_; |
12 | double getAccelX() const; | 12 | } |
13 | void setAccelX(double v); | 13 | |
14 | double getAccelY() const; | 14 | inline void setVelocityX(double v) |
15 | void setAccelY(double v); | 15 | { |
16 | 16 | velX_ = v; | |
17 | private: | 17 | } |
18 | double velocityX = 0.0; | 18 | |
19 | double velocityY = 0.0; | 19 | inline double getVelocityY() const |
20 | double accelX = 0.0; | 20 | { |
21 | double accelY = 0.0; | 21 | return velY_; |
22 | } | ||
23 | |||
24 | inline void setVelocityY(double v) | ||
25 | { | ||
26 | velY_ = v; | ||
27 | } | ||
28 | |||
29 | inline double getAccelX() const | ||
30 | { | ||
31 | return accelX_; | ||
32 | } | ||
33 | |||
34 | inline void setAccelX(double v) | ||
35 | { | ||
36 | accelX_ = v; | ||
37 | } | ||
38 | |||
39 | inline double getAccelY() const | ||
40 | { | ||
41 | return accelY_; | ||
42 | } | ||
43 | |||
44 | inline void setAccelY(double v) | ||
45 | { | ||
46 | accelY_ = v; | ||
47 | } | ||
48 | |||
49 | inline state getState() const | ||
50 | { | ||
51 | return state_; | ||
52 | } | ||
53 | |||
54 | private: | ||
55 | |||
56 | double velX_ = 0.0; | ||
57 | double velY_ = 0.0; | ||
58 | double accelX_ = 0.0; | ||
59 | double accelY_ = 0.0; | ||
22 | }; | 60 | }; |
23 | 61 | ||
24 | #endif /* end of include guard: TANGIBLE_H_746DB3EE */ | 62 | #endif /* end of include guard: TANGIBLE_H_746DB3EE */ |