Jagguar Game Engine

Loading...
Searching...
No Matches
GameObject.hpp
1#ifndef GAMEOBJECT_HPP
2#define GAMEOBJECT_HPP
3
4#include <vector>
5#include <string>
6
7#include "Component.hpp"
8
13 class GameObject {
14 public:
20 GameObject(std::string name);
21
25 ~GameObject();
26
36 void Update(SDL_Event e, int frame, std::vector<std::string> broadcastList);
37
45 void Render(SDL_Renderer *ren);
46
52 void AddComponent(Component *c);
53
59 void RemoveComponent(Component *c);
60
66 const std::vector<Component*> ListComponents();
67
73 std::string GetName();
74
75 private:
76 std::vector<Component *> m_components;
77 std::string m_name;
78
79};
80
81#endif
Component
Definition: Component.hpp:38
GameObject
Definition: GameObject.hpp:13
GameObject::AddComponent
void AddComponent(Component *c)
Definition: GameObject.cpp:13
GameObject::Render
void Render(SDL_Renderer *ren)
Definition: GameObject.cpp:31
GameObject::Update
void Update(SDL_Event e, int frame, std::vector< std::string > broadcastList)
Definition: GameObject.cpp:25
GameObject::GetName
std::string GetName()
Definition: GameObject.cpp:41
GameObject::ListComponents
const std::vector< Component * > ListComponents()
Definition: GameObject.cpp:37
GameObject::~GameObject
~GameObject()
Definition: GameObject.cpp:7
GameObject::RemoveComponent
void RemoveComponent(Component *c)
Definition: GameObject.cpp:17