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.

58 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.titleTextureDescriptions = []
  38. self.windowBackgroundColor = "#000000"
  39. self.windowHeight = 0
  40. self.windowTitle = ""
  41. self.windowWidth = 0
  42. self.victory = False
  43. def field(self, fieldName):
  44. return getattr(self, fieldName)
  45. def setField(self, fieldName, value):
  46. setattr(self, fieldName, value)
  47. def __repr__(self):
  48. return self.__str__()
  49. def __str__(self):
  50. return f"memory_Context(playfieldI/playfieldS/recentF/selectedId/selectedI: '{self.playfieldItems}'/'{self.playfieldSize}'/'{self.recentField}'/'{self.selectedId}'/'{self.selectedItems}')"
  51. def memory_createContext():
  52. return memory_Context()