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.

49 lines
1.4KB

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