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.

64 lines
1.8KB

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