diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-26 15:58:39 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-26 15:58:39 +0200 |
commit | e0b1ddae296037376948a4c6f200d89e6d1ba81e (patch) | |
tree | f70e5a9b73e0b10e5c9fe263e146e9884474ac0f /src/example/savemgr.cpp | |
parent | 2d67cf09b80297d13f642afd7db13dba53ca2b9b (diff) |
WIP save manager
Diffstat (limited to 'src/example/savemgr.cpp')
-rw-r--r-- | src/example/savemgr.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/example/savemgr.cpp b/src/example/savemgr.cpp new file mode 100644 index 0000000..810947d --- /dev/null +++ b/src/example/savemgr.cpp @@ -0,0 +1,27 @@ +/** \file + * + * Standalone example for usage of the save manager + */ + +#include <cassert> +#include <crepe/util/log.h> +#include <crepe/api/SaveManager.h> + +using namespace crepe; +using namespace crepe::api; +using namespace crepe::util; + +int main() { + const char * key = "mygame.test"; + SaveManager & mgr = SaveManager::get_instance(); + + auto & prop = mgr.get<unsigned int>(key, 1); + prop = 2; + + mgr.set<unsigned int>(key, 3); + + assert(true == mgr.has(key)); + + return 0; +} + |