summary refs log tree commit diff stats
path: root/src/components/controllable.h
blob: 317d68d07fc138c47e355e86d308fc8083e27287 (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
#ifndef CONTROLLABLE_H_4E0B85B4
#define CONTROLLABLE_H_4E0B85B4

#include "component.h"
#include "renderer.h"

class ControllableComponent : public Component {
  public:
    int getLeftKey() const;
    void setLeftKey(int k);
    int getRightKey() const;
    void setRightKey(int k);
    int getJumpKey() const;
    void setJumpKey(int k);
    int getDropKey() const;
    void setDropKey(int k);
    
    bool isFrozen() const;
    void setFrozen(bool f);
    bool isHoldingLeft() const;
    void setHoldingLeft(bool f);
    bool isHoldingRight() const;
    void setHoldingRight(bool f);
    
  private:
    int leftKey = GLFW_KEY_LEFT;
    int rightKey = GLFW_KEY_RIGHT;
    int jumpKey = GLFW_KEY_UP;
    int dropKey = GLFW_KEY_DOWN;
    
    bool frozen = false;
    bool holdingLeft = false;
    bool holdingRight = false;
};

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