Game Engine 2D Platformer
InputComponent.hpp
Go to the documentation of this file.
1 /*
2  * @file InputComponent.hpp
3  * @brief InputComponent class interface
4  * @date 2021-03-12
5  ***********************************************/
6 #ifndef INPUTCOMPONENT_HPP
7 #define INPUTCOMPONENT_HPP
8 
9 #include "Component.hpp"
10 
13 class InputComponent : public Component
14 {
15 public:
27  void StartUp();
31  void Update(GameEntity& entity);
35  void HandleEvent(GameEntity &entity);
36 
37 private:
38  bool backPressed = false;
39 };
40 
41 #endif
The interface class for different components to inherit.
Definition: Component.hpp:16
Represents an interactable entity in the game that includes Main Character, NPC, Tiles ,...
Definition: GameEntity.hpp:22
InputComponent class used to change velocity due to keyboard input.
Definition: InputComponent.hpp:14
void HandleEvent(GameEntity &entity)
Handles the event for GameEntity.
Definition: InputComponent.cpp:25
~InputComponent()
Destructor for InputComponent.
Definition: InputComponent.cpp:12
void Update(GameEntity &entity)
Updates the GameEntity upon keypress.
Definition: InputComponent.cpp:20
InputComponent()
Constuctor for InputComponent.
Definition: InputComponent.cpp:8
void StartUp()
Initializes attributes for InputComponent.
Definition: InputComponent.cpp:16