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.

56 lines
1.6KB

  1. class memory_Context:
  2. def __init__(self):
  3. self.cellSize = 0
  4. self.deselectMismatchedTiles = False
  5. self.deselectMismatchedTilesDelay = 0
  6. self.didLaunch = False
  7. self.exit = False
  8. self.hiddenItems = []
  9. self.hideMatchingTiles = False
  10. self.hideMatchingTilesDelay = 0
  11. self.input = ""
  12. self.mismatchedItems = []
  13. self.outputGoOn = ""
  14. self.outputGreeting = ""
  15. self.outputHelp = ""
  16. self.outputMatchedItems = ""
  17. self.outputMismatchedItems = ""
  18. self.outputPromptSelection = ""
  19. self.outputVictory = ""
  20. self.playfieldItems = {}
  21. self.playfieldSize = 0
  22. self.recentField = "none"
  23. self.selectedId = -1
  24. self.selectedItems = []
  25. self.textureDescriptions = []
  26. self.tileImage = ""
  27. self.tileImageCount = 0
  28. self.tileImageHeight = 0
  29. self.tileImageWidth = 0
  30. self.tilePositions = []
  31. self.titleImage = ""
  32. self.titleImageCount = 0
  33. self.titleImageHeight = 0
  34. self.titleImageWidth = 0
  35. self.titlePosition = []
  36. self.windowBackgroundColor = "#000000"
  37. self.windowHeight = 0
  38. self.windowTitle = ""
  39. self.windowWidth = 0
  40. self.victory = False
  41. def field(self, fieldName):
  42. return getattr(self, fieldName)
  43. def setField(self, fieldName, value):
  44. setattr(self, fieldName, value)
  45. def __repr__(self):
  46. return self.__str__()
  47. def __str__(self):
  48. return f"memory_Context(playfieldI/playfieldS/recentF/selectedId/selectedI: '{self.playfieldItems}'/'{self.playfieldSize}'/'{self.recentField}'/'{self.selectedId}'/'{self.selectedItems}')"
  49. def memory_createContext():
  50. return memory_Context()