The world holds all active levels in the game.
More...
#include <World.h>
Inherits Fling::NonCopyable.
The world holds all active levels in the game.
There will only ever be exactly one World instance at any given time.
- See also
- Level
◆ World()
| Fling::World::World |
( |
entt::registry & |
t_Reg, |
|
|
Fling::Game * |
t_Game |
|
) |
| |
|
explicit |
◆ GetRegistry()
| FORCEINLINE entt::registry& Fling::World::GetRegistry |
( |
| ) |
const |
|
inline |
◆ Init()
| void Fling::World::Init |
( |
| ) |
|
Initializes the world.
Loads the StartLevel that is specified in the config.
- Note
- Keep explicit Init and Shutdown functions to make the startup order more readable
◆ LoadLevelFile()
template<class ... ARGS>
| bool Fling::World::LoadLevelFile |
( |
const std::string & |
t_LevelToLoad | ) |
|
Reset the current registry and load in new entities/components from a JSON file This will read in some core engine components along with the specified custom game components.
- Template Parameters
-
| ARGS | Any component types from your game that need to be serialized |
- Parameters
-
| t_LevelToLoad | File path to load (relative to the assets directory) |
- Returns
- True on success
◆ OutputLevelFile()
template<class ... ARGS>
| bool Fling::World::OutputLevelFile |
( |
const std::string & |
t_LevelToLoad | ) |
|
Based on all current entities in the registry serialize that data to a JSON file This will write out some core engine components along with the specified custom game components.
- Template Parameters
-
| ARGS | Any component types from your game that need to be serialized |
- Parameters
-
| t_LevelToLoad | File path to load (relative to the assets directory) |
- Returns
- True on success
◆ ShouldQuit()
| FORCEINLINE bool Fling::World::ShouldQuit |
( |
| ) |
const |
|
inline |
Check if the world wants to exit the program.
- See also
- Engine::Tick
- Returns
- True if the world has signaled for exit
◆ Shutdown()
| void Fling::World::Shutdown |
( |
| ) |
|
Called just before destruction.
◆ Update()
| void Fling::World::Update |
( |
float |
t_DeltaTime | ) |
|
Tick all active levels in the world.
- Parameters
-
| t_DeltaTime | Time between previous frame and the current one. |
◆ m_Game
The game will allow users to specify their own update/read/write functions.
◆ m_Registry
| entt::registry& Fling::World::m_Registry |
|
private |
The registry and represents all active entities in this world.
◆ m_ShouldQuit
| UINT8 Fling::World::m_ShouldQuit = false |
|
private |
Flag if the world should quit or not!
The documentation for this class was generated from the following files: