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.

memory_Context.py 1.1KB

5 months ago
4 months ago
5 months ago
12345678910111213141516171819202122232425262728293031323334353637383940
  1. class memory_Context:
  2. def __init__(self):
  3. self.didLaunch = False
  4. self.exit = False
  5. self.hiddenItems = []
  6. self.input = ""
  7. self.mismatchedItems = []
  8. self.outputGoOn = ""
  9. self.outputGreeting = ""
  10. self.outputHelp = ""
  11. self.outputMatchedItems = ""
  12. self.outputMismatchedItems = ""
  13. self.outputPromptSelection = ""
  14. self.outputVictory = ""
  15. self.playfieldItems = {}
  16. self.playfieldSize = 0
  17. self.recentField = "none"
  18. self.selectedId = -1
  19. self.selectedItems = []
  20. self.textureDescriptions = []
  21. self.tileImage = ""
  22. self.tileImageCount = 0
  23. self.tileImageHeight = 0
  24. self.tileImageWidth = 0
  25. self.victory = False
  26. def field(self, fieldName):
  27. return getattr(self, fieldName)
  28. def setField(self, fieldName, value):
  29. setattr(self, fieldName, value)
  30. def __repr__(self):
  31. return self.__str__()
  32. def __str__(self):
  33. return f"memory_Context(playfieldI/playfieldS/recentF/selectedId/selectedI: '{self.playfieldItems}'/'{self.playfieldSize}'/'{self.recentField}'/'{self.selectedId}'/'{self.selectedItems}')"
  34. def memory_createContext():
  35. return memory_Context()