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.

57 lines
1.6KB

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