System for managing the current map and previous maps.
More...
#include <World.hpp>
System for managing the current map and previous maps.
Definition at line 21 of file World.hpp.
◆ World()
core::system::World::World |
( |
Systems & |
systems | ) |
|
Creates the world system.
- Parameters
-
systems | A reference to the parent Systems object |
Definition at line 16 of file World.cpp.
◆ ~World()
virtual core::system::World::~World |
( |
| ) |
|
|
virtualdefault |
◆ activeMap() [1/2]
map::Map & core::system::World::activeMap |
( |
| ) |
|
Returns a reference to the active map.
Definition at line 84 of file World.cpp.
◆ activeMap() [2/2]
const map::Map & core::system::World::activeMap |
( |
| ) |
const |
Returns a const reference to the active map.
Definition at line 86 of file World.cpp.
◆ observe() [1/2]
Adds saved world data to the save file.
Definition at line 92 of file World.cpp.
◆ observe() [2/2]
Initializes world state from the loading game save.
Definition at line 100 of file World.cpp.
◆ setWhiteoutMap()
void core::system::World::setWhiteoutMap |
( |
unsigned int |
spawn | ) |
|
Sets the respawn point to the given spawn in the current map.
- Parameters
-
spawn | The spawn to respawn at |
Definition at line 79 of file World.cpp.
◆ switchMaps()
bool core::system::World::switchMaps |
( |
const std::string & |
newMap, |
|
|
int |
spawnId |
|
) |
| |
Switches the current map to the map in the given file.
- Parameters
-
newMap | Filename of new map, or "LastMap" for previous map |
spawnId | The id to spawn at. Ignored if "LastMap" is specified |
- Returns
- True if the new map could be loaded and switched to, false on error
Definition at line 26 of file World.cpp.
◆ whiteout()
void core::system::World::whiteout |
( |
const std::string & |
newMap, |
|
|
int |
spawnId |
|
) |
| |
Switches to the new map and resets the last map to empty.
- Parameters
-
newMap | The map to whiteout into |
spawnId | Where to spawn |
Definition at line 72 of file World.cpp.
The documentation for this class was generated from the following files: