Research portable Memory game | Исследовать портируемую игру Память
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
946B

  1. #include <map>
  2. #include <string>
  3. #include <vector>
  4. #include "ctx.h"
  5. #ifndef memory_Context_HEADER
  6. #define memory_Context_HEADER
  7. struct memory_Context {
  8. bool didLaunch = false;
  9. bool exit = false;
  10. std::string input = "";
  11. std::vector<int> hiddenItems;
  12. std::vector<int> mismatchedItems;
  13. std::string recentField = "none";
  14. std::string outputGoOn = "";
  15. std::string outputGreeting = "";
  16. std::string outputHelp = "";
  17. std::string outputMatchedItems = "";
  18. std::string outputMismatchedItems = "";
  19. std::string outputPromptSelection = "";
  20. std::string outputVictory = "";
  21. std::map<int, int> playfieldItems;
  22. int playfieldSize = 0;
  23. int selectedId = -1;
  24. std::vector<int> selectedItems;
  25. bool victory = false;
  26. template <typename T> T field(const std::string &fieldName);
  27. template <typename T> void setField(const std::string &fieldName, T value);
  28. };
  29. memory_Context memory_createContext();
  30. #endif // memory_Context_HEADER