|
@@ -1,9 +1,9 @@ |
|
|
#include <any> |
|
|
|
|
|
|
|
|
#include "any.h" |
|
|
#include "memory_Context.h" |
|
|
#include "memory_Context.h" |
|
|
|
|
|
|
|
|
#include <iostream> |
|
|
#include <iostream> |
|
|
|
|
|
|
|
|
std::any memory_Context::field(const std::string &fieldName) { |
|
|
|
|
|
|
|
|
libany::any memory_Context::field(const std::string &fieldName) { |
|
|
if (fieldName == "didLaunch") { |
|
|
if (fieldName == "didLaunch") { |
|
|
return didLaunch; |
|
|
return didLaunch; |
|
|
} else if (fieldName == "exit") { |
|
|
} else if (fieldName == "exit") { |
|
@@ -41,41 +41,41 @@ std::any memory_Context::field(const std::string &fieldName) { |
|
|
return victory; |
|
|
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") { |
|
|
if (fieldName == "didLaunch") { |
|
|
didLaunch = std::any_cast<bool>(value); |
|
|
|
|
|
|
|
|
didLaunch = libany::any_cast<bool>(value); |
|
|
} else if (fieldName == "exit") { |
|
|
} else if (fieldName == "exit") { |
|
|
exit = std::any_cast<bool>(value); |
|
|
|
|
|
|
|
|
exit = libany::any_cast<bool>(value); |
|
|
} else if (fieldName == "hiddenItems") { |
|
|
} else if (fieldName == "hiddenItems") { |
|
|
hiddenItems = std::any_cast<std::vector<int> >(value); |
|
|
|
|
|
|
|
|
hiddenItems = libany::any_cast<std::vector<int> >(value); |
|
|
} else if (fieldName == "input") { |
|
|
} else if (fieldName == "input") { |
|
|
input = std::any_cast<std::string>(value); |
|
|
|
|
|
|
|
|
input = libany::any_cast<std::string>(value); |
|
|
} else if (fieldName == "mismatchedItems") { |
|
|
} else if (fieldName == "mismatchedItems") { |
|
|
mismatchedItems = std::any_cast<std::vector<int> >(value); |
|
|
|
|
|
|
|
|
mismatchedItems = libany::any_cast<std::vector<int> >(value); |
|
|
} else if (fieldName == "outputGoOn") { |
|
|
} else if (fieldName == "outputGoOn") { |
|
|
outputGoOn = std::any_cast<std::string>(value); |
|
|
|
|
|
|
|
|
outputGoOn = libany::any_cast<std::string>(value); |
|
|
} else if (fieldName == "outputGreeting") { |
|
|
} else if (fieldName == "outputGreeting") { |
|
|
outputGreeting = std::any_cast<std::string>(value); |
|
|
|
|
|
|
|
|
outputGreeting = libany::any_cast<std::string>(value); |
|
|
} else if (fieldName == "outputHelp") { |
|
|
} else if (fieldName == "outputHelp") { |
|
|
outputHelp = std::any_cast<std::string>(value); |
|
|
|
|
|
|
|
|
outputHelp = libany::any_cast<std::string>(value); |
|
|
} else if (fieldName == "outputMatchedItems") { |
|
|
} else if (fieldName == "outputMatchedItems") { |
|
|
outputMatchedItems = std::any_cast<std::string>(value); |
|
|
|
|
|
|
|
|
outputMatchedItems = libany::any_cast<std::string>(value); |
|
|
} else if (fieldName == "outputMismatchedItems") { |
|
|
} else if (fieldName == "outputMismatchedItems") { |
|
|
outputMismatchedItems = std::any_cast<std::string>(value); |
|
|
|
|
|
|
|
|
outputMismatchedItems = libany::any_cast<std::string>(value); |
|
|
} else if (fieldName == "outputPromptSelection") { |
|
|
} else if (fieldName == "outputPromptSelection") { |
|
|
outputPromptSelection = std::any_cast<std::string>(value); |
|
|
|
|
|
|
|
|
outputPromptSelection = libany::any_cast<std::string>(value); |
|
|
} else if (fieldName == "outputVictory") { |
|
|
} else if (fieldName == "outputVictory") { |
|
|
outputVictory = std::any_cast<std::string>(value); |
|
|
|
|
|
|
|
|
outputVictory = libany::any_cast<std::string>(value); |
|
|
} else if (fieldName == "playfieldItems") { |
|
|
} else if (fieldName == "playfieldItems") { |
|
|
playfieldItems = std::any_cast<std::map<int, int> >(value); |
|
|
|
|
|
|
|
|
playfieldItems = libany::any_cast<std::map<int, int> >(value); |
|
|
} else if (fieldName == "playfieldSize") { |
|
|
} else if (fieldName == "playfieldSize") { |
|
|
playfieldSize = std::any_cast<int>(value); |
|
|
|
|
|
|
|
|
playfieldSize = libany::any_cast<int>(value); |
|
|
} else if (fieldName == "selectedId") { |
|
|
} else if (fieldName == "selectedId") { |
|
|
selectedId = std::any_cast<int>(value); |
|
|
|
|
|
|
|
|
selectedId = libany::any_cast<int>(value); |
|
|
} else if (fieldName == "selectedItems") { |
|
|
} else if (fieldName == "selectedItems") { |
|
|
selectedItems = std::any_cast<std::vector<int> >(value); |
|
|
|
|
|
|
|
|
selectedItems = libany::any_cast<std::vector<int> >(value); |
|
|
} else if (fieldName == "victory") { |
|
|
} else if (fieldName == "victory") { |
|
|
victory = std::any_cast<bool>(value); |
|
|
|
|
|
|
|
|
victory = libany::any_cast<bool>(value); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|