aboutsummaryrefslogtreecommitdiff
path: root/src/example/savemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/example/savemgr.cpp')
-rw-r--r--src/example/savemgr.cpp27
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;
+}
+