From f2651048569d04fd33063f9c12bd9ff47d1079c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Wed, 5 Jun 2024 23:19:23 +0300 Subject: [PATCH] d --- v4/gen-C++ | 4 +--- v4/memory_Context.cpp | 40 ++++++++++++++++++++-------------------- v4/memory_Context.h | 6 +++--- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/v4/gen-C++ b/v4/gen-C++ index 4502a20..23c8529 100755 --- a/v4/gen-C++ +++ b/v4/gen-C++ @@ -1,6 +1,4 @@ -#c++ -o test_memory_C++ -std=c++11 -I. \ -#c++ -o test_memory_C++ -std=c++17 -I. \ -c++ -o test_memory_C++ -std=c++20 -I. \ +c++ -o test_memory_C++ -std=c++11 -I. \ memory.cpp \ memory_Context.cpp \ memory_test.cpp \ diff --git a/v4/memory_Context.cpp b/v4/memory_Context.cpp index c5b33a8..ca5ff09 100644 --- a/v4/memory_Context.cpp +++ b/v4/memory_Context.cpp @@ -1,9 +1,9 @@ -#include +#include "any.h" #include "memory_Context.h" #include -std::any memory_Context::field(const std::string &fieldName) { +libany::any memory_Context::field(const std::string &fieldName) { if (fieldName == "didLaunch") { return didLaunch; } else if (fieldName == "exit") { @@ -41,41 +41,41 @@ std::any memory_Context::field(const std::string &fieldName) { return victory; } -void memory_Context::setField(const std::string &fieldName, std::any value) { +void memory_Context::setField(const std::string &fieldName, libany::any value) { if (fieldName == "didLaunch") { - didLaunch = std::any_cast(value); + didLaunch = libany::any_cast(value); } else if (fieldName == "exit") { - exit = std::any_cast(value); + exit = libany::any_cast(value); } else if (fieldName == "hiddenItems") { - hiddenItems = std::any_cast >(value); + hiddenItems = libany::any_cast >(value); } else if (fieldName == "input") { - input = std::any_cast(value); + input = libany::any_cast(value); } else if (fieldName == "mismatchedItems") { - mismatchedItems = std::any_cast >(value); + mismatchedItems = libany::any_cast >(value); } else if (fieldName == "outputGoOn") { - outputGoOn = std::any_cast(value); + outputGoOn = libany::any_cast(value); } else if (fieldName == "outputGreeting") { - outputGreeting = std::any_cast(value); + outputGreeting = libany::any_cast(value); } else if (fieldName == "outputHelp") { - outputHelp = std::any_cast(value); + outputHelp = libany::any_cast(value); } else if (fieldName == "outputMatchedItems") { - outputMatchedItems = std::any_cast(value); + outputMatchedItems = libany::any_cast(value); } else if (fieldName == "outputMismatchedItems") { - outputMismatchedItems = std::any_cast(value); + outputMismatchedItems = libany::any_cast(value); } else if (fieldName == "outputPromptSelection") { - outputPromptSelection = std::any_cast(value); + outputPromptSelection = libany::any_cast(value); } else if (fieldName == "outputVictory") { - outputVictory = std::any_cast(value); + outputVictory = libany::any_cast(value); } else if (fieldName == "playfieldItems") { - playfieldItems = std::any_cast >(value); + playfieldItems = libany::any_cast >(value); } else if (fieldName == "playfieldSize") { - playfieldSize = std::any_cast(value); + playfieldSize = libany::any_cast(value); } else if (fieldName == "selectedId") { - selectedId = std::any_cast(value); + selectedId = libany::any_cast(value); } else if (fieldName == "selectedItems") { - selectedItems = std::any_cast >(value); + selectedItems = libany::any_cast >(value); } else if (fieldName == "victory") { - victory = std::any_cast(value); + victory = libany::any_cast(value); } } diff --git a/v4/memory_Context.h b/v4/memory_Context.h index 0a43ac8..d56910c 100644 --- a/v4/memory_Context.h +++ b/v4/memory_Context.h @@ -1,7 +1,7 @@ -#include #include #include #include +#include "any.h" #include "ctx.h" #ifndef memory_Context_HEADER @@ -27,8 +27,8 @@ struct memory_Context { std::vector selectedItems; bool victory = false; - std::any field(const std::string &fieldName); - void setField(const std::string &fieldName, std::any value); + libany::any field(const std::string &fieldName); + void setField(const std::string &fieldName, libany::any value); }; memory_Context memory_createContext();