![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Represents a game save and provides functionality to load and save. More...
#include <GameSave.hpp>
Classes | |
struct | ClockPointers |
Stores the date in game. More... | |
struct | InteractDataPointers |
Stores pointers to the actual data to save/load from. More... | |
struct | PlayerDataPointers |
Stores pointers to the actual data to save/load from. More... | |
struct | ScriptDataPointers |
Stores pointers to the actual data to save/load from. More... | |
struct | TrainerPointers |
Stores defeated trainer information. More... | |
struct | WorldDataPointers |
Stores pointers to the actual data to save/load from. More... | |
Public Member Functions | |
GameSave () | |
Initializes all pointers to the local members. More... | |
bool | load () |
Loads the save represented by this object and fires an event::GameSaveLoaded event to allow systems to populate their data. More... | |
void | editorSave () |
Saves the data back to the file it was loaded from. More... | |
bool | remove () const |
Deletes the game save. More... | |
bool | operator< (const GameSave &rhs) const |
For sorting. More... | |
void | useLocalData () |
Instantiates the save data in this object and sets all the pointers to it. Useful for loading a save without populating the game systems. More... | |
Static Public Member Functions | |
static void | listSaves (std::vector< GameSave > &result) |
Lists all saves in the save directory. More... | |
static bool | saveGame (const std::string &name) |
Saves the game. Fires an event::GameSaveInitializing event for systems to add their data to the save before it is written. More... | |
static bool | loadFromFile (const std::string &sourceFile) |
Loads the game from the given save file. More... | |
static std::string | filename (const std::string &saveName) |
Returns the filename for the given save name. More... | |
Public Attributes | |
unsigned long long | saveTime |
Local timestamp that the save was modified on. More... | |
std::string | saveName |
Same as the player name but always valid. More... | |
struct core::file::GameSave::InteractDataPointers | interaction |
struct core::file::GameSave::PlayerDataPointers | player |
struct core::file::GameSave::WorldDataPointers | world |
struct core::file::GameSave::ScriptDataPointers | scripts |
struct core::file::GameSave::ClockPointers | clock |
struct core::file::GameSave::TrainerPointers | trainers |
Represents a game save and provides functionality to load and save.
Definition at line 24 of file GameSave.hpp.
core::file::GameSave::GameSave | ( | ) |
Initializes all pointers to the local members.
Definition at line 152 of file GameSave.cpp.
void core::file::GameSave::editorSave | ( | ) |
Saves the data back to the file it was loaded from.
Definition at line 84 of file GameSave.cpp.
|
static |
Returns the filename for the given save name.
saveName | The name of the player in the save |
Definition at line 180 of file GameSave.cpp.
|
static |
Lists all saves in the save directory.
result | Vector to populate with found saves |
Definition at line 40 of file GameSave.cpp.
bool core::file::GameSave::load | ( | ) |
Loads the save represented by this object and fires an event::GameSaveLoaded event to allow systems to populate their data.
Definition at line 90 of file GameSave.cpp.
|
static |
Loads the game from the given save file.
sourceFile | The file to load from |
Definition at line 78 of file GameSave.cpp.
bool core::file::GameSave::operator< | ( | const GameSave & | rhs | ) | const |
For sorting.
rhs | The save to compare to |
Definition at line 116 of file GameSave.cpp.
bool core::file::GameSave::remove | ( | ) | const |
Deletes the game save.
Definition at line 114 of file GameSave.cpp.
|
static |
Saves the game. Fires an event::GameSaveInitializing event for systems to add their data to the save before it is written.
name | The name of the player |
Definition at line 62 of file GameSave.cpp.
void core::file::GameSave::useLocalData | ( | ) |
Instantiates the save data in this object and sets all the pointers to it. Useful for loading a save without populating the game systems.
Definition at line 121 of file GameSave.cpp.
struct core::file::GameSave::ClockPointers core::file::GameSave::clock |
struct core::file::GameSave::InteractDataPointers core::file::GameSave::interaction |
struct core::file::GameSave::PlayerDataPointers core::file::GameSave::player |
std::string core::file::GameSave::saveName |
Same as the player name but always valid.
Definition at line 29 of file GameSave.hpp.
unsigned long long core::file::GameSave::saveTime |
Local timestamp that the save was modified on.
Definition at line 26 of file GameSave.hpp.
struct core::file::GameSave::ScriptDataPointers core::file::GameSave::scripts |
struct core::file::GameSave::TrainerPointers core::file::GameSave::trainers |
struct core::file::GameSave::WorldDataPointers core::file::GameSave::world |