Research portable Memory game | Исследовать портируемую игру Память
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

38 lines
999B

  1. from memory_Context import *
  2. from gui_TextureDescription import *
  3. from llm import *
  4. # Generate textures descriptions
  5. #
  6. # Conditions:
  7. # 1. tileImage or tileImageCount or tileImageHeight or tileImageWidth has just changed
  8. # 2. tileImage, tileImageCount, tileImageHeight, tileImageWidth are not empty
  9. @llm_by_value
  10. def gui_generateTextureDescriptions(
  11. c: memory_Context
  12. ) -> memory_Context:
  13. if (
  14. c.recentField == "tileImage" or
  15. c.recentField == "tileImageCount" or
  16. c.recentField == "tileImageHeight" or
  17. c.recentField == "tileImageWidth"
  18. ):
  19. tds: list[gui_TextureDescription] = []
  20. for id in range(0, c.tileImageCount):
  21. td = gui_createTextureDescription()
  22. td.fileName = c.tileImage
  23. td.height = c.tileImageHeight
  24. td.width = c.tileImageWidth
  25. td.x = id * c.tileImageWidth
  26. td.y = 0
  27. tds.append(td)
  28. #}
  29. c.textureDescriptions = tds
  30. c.recentField = "textureDescriptions"
  31. return c
  32. #}
  33. c.recentField = "none"
  34. return c
  35. #}