From f12e2936fda51eb59016dd316ff9c73fba621fa2 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Fri, 12 Jan 2018 16:31:16 +0000 Subject: Add basic global_cache interface --- src/main/game/global_cache.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/main/game/global_cache.cpp (limited to 'src/main/game/global_cache.cpp') diff --git a/src/main/game/global_cache.cpp b/src/main/game/global_cache.cpp new file mode 100644 index 0000000..cc95b3b --- /dev/null +++ b/src/main/game/global_cache.cpp @@ -0,0 +1,16 @@ +// +// Created by thecharlesblake on 1/10/18. +// + +#include "global_cache.h" + + +global_cache::global_cache(const sol_rules&) {} + +bool global_cache::insert(const std::vector& pile_vec) { + return u_set.insert(pile_vec).second; +} + +bool global_cache::contains(const std::vector& pile_vec) { + return u_set.count(pile_vec) > 0; +} -- cgit v1.2.1