aboutsummaryrefslogtreecommitdiff
path: root/src/example/savemgr.cpp
blob: 810947d248602a7ebed1a83b7552e9360f686360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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;
}