diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-27 16:50:20 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-27 16:50:20 +0100 |
commit | ecc5761fa78ccb57db958467c3fc999aceadd409 (patch) | |
tree | 8e5f24133473de3f122d59262727a9f0a3a806c9 /src/example/savemgr.cpp | |
parent | e0b1ddae296037376948a4c6f200d89e6d1ba81e (diff) |
fix valuebroker/proxy system
Diffstat (limited to 'src/example/savemgr.cpp')
-rw-r--r-- | src/example/savemgr.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/example/savemgr.cpp b/src/example/savemgr.cpp index 810947d..5c034c4 100644 --- a/src/example/savemgr.cpp +++ b/src/example/savemgr.cpp @@ -5,6 +5,7 @@ #include <cassert> #include <crepe/util/log.h> +#include <crepe/util/Proxy.h> #include <crepe/api/SaveManager.h> using namespace crepe; @@ -15,9 +16,11 @@ int main() { const char * key = "mygame.test"; SaveManager & mgr = SaveManager::get_instance(); - auto & prop = mgr.get<unsigned int>(key, 1); - prop = 2; + ValueBroker<unsigned int> & prop = mgr.get<unsigned int>(key, 0); + Proxy<unsigned int> val = mgr.get<unsigned int>(key, 0); + prop.set(1); + val = 2; mgr.set<unsigned int>(key, 3); assert(true == mgr.has(key)); |