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.

42 lines
1.2KB

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