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.

48 lines
1.3KB

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