diff options
Diffstat (limited to 'src/components/orientable.h')
-rw-r--r-- | src/components/orientable.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/components/orientable.h b/src/components/orientable.h index 8f56912..e356b78 100644 --- a/src/components/orientable.h +++ b/src/components/orientable.h | |||
@@ -6,6 +6,18 @@ | |||
6 | class OrientableComponent : public Component { | 6 | class OrientableComponent : public Component { |
7 | public: | 7 | public: |
8 | 8 | ||
9 | enum class WalkState { | ||
10 | still, | ||
11 | left, | ||
12 | right | ||
13 | }; | ||
14 | |||
15 | enum class DropState { | ||
16 | none, | ||
17 | ready, | ||
18 | active | ||
19 | }; | ||
20 | |||
9 | inline bool isFacingRight() const | 21 | inline bool isFacingRight() const |
10 | { | 22 | { |
11 | return facingRight_; | 23 | return facingRight_; |
@@ -16,9 +28,42 @@ public: | |||
16 | facingRight_ = v; | 28 | facingRight_ = v; |
17 | } | 29 | } |
18 | 30 | ||
31 | inline WalkState getWalkState() const | ||
32 | { | ||
33 | return walkState_; | ||
34 | } | ||
35 | |||
36 | inline void setWalkState(WalkState v) | ||
37 | { | ||
38 | walkState_ = v; | ||
39 | } | ||
40 | |||
41 | inline bool isJumping() const | ||
42 | { | ||
43 | return jumping_; | ||
44 | } | ||
45 | |||
46 | inline void setJumping(bool v) | ||
47 | { | ||
48 | jumping_ = v; | ||
49 | } | ||
50 | |||
51 | inline DropState getDropState() const | ||
52 | { | ||
53 | return dropState_; | ||
54 | } | ||
55 | |||
56 | inline void setDropState(DropState v) | ||
57 | { | ||
58 | dropState_ = v; | ||
59 | } | ||
60 | |||
19 | private: | 61 | private: |
20 | 62 | ||
21 | bool facingRight_ = false; | 63 | bool facingRight_ = false; |
64 | WalkState walkState_ = WalkState::still; | ||
65 | bool jumping_ = false; | ||
66 | DropState dropState_ = DropState::none; | ||
22 | }; | 67 | }; |
23 | 68 | ||
24 | #endif /* end of include guard: ORIENTABLE_H_EDB6C4A1 */ | 69 | #endif /* end of include guard: ORIENTABLE_H_EDB6C4A1 */ |