Building Game Engines
GameObject.hpp
Go to the documentation of this file.
1 #ifndef GAME_OBJECT_HPP
2 #define GAME_OBJECT_HPP
3 
4 #include <SDL2/SDL.h>
5 
6 #include <vector>
7 #include <algorithm>
8 
9 #include "Component.hpp"
10 #include "ControllerComponent.hpp"
11 #include "TileMap.hpp"
12 
16 class GameObject {
17  public:
21  GameObject();
22 
26  ~GameObject();
27 
31  void Input(SDL_Event e);
32 
36  void Update();
37 
41  void Render(SDL_Renderer* renderer);
42 
46  void AddComponent(Component* c);
47 
51  void RemoveComponent();
52 
53 
54  //private: JUST FOR TESTING FOR NOW
55  // Points to all the components of this game object
56  std::vector<Component*> m_components;
57 };
58 
59 #endif
void Input(SDL_Event e)
Definition: GameObject.cpp:11
std::vector< Component * > m_components
Definition: GameObject.hpp:56
GameObject()
Definition: GameObject.cpp:5
void RemoveComponent()
Definition: GameObject.cpp:44
void Update()
Definition: GameObject.cpp:20
Definition: Component.hpp:10
~GameObject()
Definition: GameObject.cpp:7
Definition: GameObject.hpp:16
void Render(SDL_Renderer *renderer)
Definition: GameObject.cpp:34
void AddComponent(Component *c)
Definition: GameObject.cpp:40