summary refs log tree commit diff stats
path: root/src/components/orientable.h
blob: e356b78f78102fb3c601cc69f3ab2ae3288e7cf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef ORIENTABLE_H_EDB6C4A1
#define ORIENTABLE_H_EDB6C4A1

#include "component.h"

class OrientableComponent : public Component {
public:

  enum class WalkState {
    still,
    left,
    right
  };

  enum class DropState {
    none,
    ready,
    active
  };

  inline bool isFacingRight() const
  {
    return facingRight_;
  }

  inline void setFacingRight(bool v)
  {
    facingRight_ = v;
  }

  inline WalkState getWalkState() const
  {
    return walkState_;
  }

  inline void setWalkState(WalkState v)
  {
    walkState_ = v;
  }

  inline bool isJumping() const
  {
    return jumping_;
  }

  inline void setJumping(bool v)
  {
    jumping_ = v;
  }

  inline DropState getDropState() const
  {
    return dropState_;
  }

  inline void setDropState(DropState v)
  {
    dropState_ = v;
  }

private:

  bool facingRight_ = false;
  WalkState walkState_ = WalkState::still;
  bool jumping_ = false;
  DropState dropState_ = DropState::none;
};

#endif /* end of include guard: ORIENTABLE_H_EDB6C4A1 */