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.

memory_Context.py 1.4KB

6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.windowBackgroundColor = "#000000"
  32. self.windowHeight = 0
  33. self.windowTitle = ""
  34. self.windowWidth = 0
  35. self.victory = False
  36. def field(self, fieldName):
  37. return getattr(self, fieldName)
  38. def setField(self, fieldName, value):
  39. setattr(self, fieldName, value)
  40. def __repr__(self):
  41. return self.__str__()
  42. def __str__(self):
  43. return f"memory_Context(playfieldI/playfieldS/recentF/selectedId/selectedI: '{self.playfieldItems}'/'{self.playfieldSize}'/'{self.recentField}'/'{self.selectedId}'/'{self.selectedItems}')"
  44. def memory_createContext():
  45. return memory_Context()