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.

gui.py 999B

4 kuukautta sitten
12345678910111213141516171819202122232425262728293031323334353637
  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. #}