Platformer
Platformer
GameWorld.hpp
1 #ifndef GAME_WORLD_HPP
2 #define GAME_WORLD_HPP
3 
4 #include <vector>
5 
6 #include "GameObject.hpp"
7 
12 class GameWorld {
13  public:
15  GameWorld();
16 
20  void Update();
21 
26  std::vector<std::shared_ptr<GameObject>> GetActiveObjects() const;
27 
29  void RegisterObject(
30  std::shared_ptr<GameObject> obj);
31 
32  private:
34  std::vector<std::shared_ptr<GameObject>> objects;
35 };
36 
37 #endif
std::vector< std::shared_ptr< GameObject > > objects
The list of all objects in the world.
Definition: GameWorld.hpp:34
void Update()
Updates this world.
Definition: GameWorld.cpp:5
std::vector< std::shared_ptr< GameObject > > GetActiveObjects() const
Gets the list of all active objects in our world.
Definition: GameWorld.cpp:13
GameWorld()
Constructs a GameWorld.
Definition: GameWorld.cpp:3
This class represents the game world.
Definition: GameWorld.hpp:12
void RegisterObject(std::shared_ptr< GameObject > obj)
Registers an object in the world.
Definition: GameWorld.cpp:23