diff options
Diffstat (limited to 'src/components/ponderable.h')
-rw-r--r-- | src/components/ponderable.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/components/ponderable.h b/src/components/ponderable.h index 80100d7..dfbf908 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h | |||
@@ -6,6 +6,13 @@ | |||
6 | class PonderableComponent : public Component { | 6 | class PonderableComponent : public Component { |
7 | public: | 7 | public: |
8 | 8 | ||
9 | enum class state { | ||
10 | grounded, | ||
11 | jumping, | ||
12 | falling, | ||
13 | dropping | ||
14 | }; | ||
15 | |||
9 | inline double getVelocityX() const | 16 | inline double getVelocityX() const |
10 | { | 17 | { |
11 | return velX_; | 18 | return velX_; |
@@ -51,12 +58,18 @@ public: | |||
51 | return state_; | 58 | return state_; |
52 | } | 59 | } |
53 | 60 | ||
61 | inline void setState(state arg) | ||
62 | { | ||
63 | state_ = arg; | ||
64 | } | ||
65 | |||
54 | private: | 66 | private: |
55 | 67 | ||
56 | double velX_ = 0.0; | 68 | double velX_ = 0.0; |
57 | double velY_ = 0.0; | 69 | double velY_ = 0.0; |
58 | double accelX_ = 0.0; | 70 | double accelX_ = 0.0; |
59 | double accelY_ = 0.0; | 71 | double accelY_ = 0.0; |
72 | state state_ = state::grounded; | ||
60 | }; | 73 | }; |
61 | 74 | ||
62 | #endif /* end of include guard: TANGIBLE_H_746DB3EE */ | 75 | #endif /* end of include guard: TANGIBLE_H_746DB3EE */ |