Михаил Капелько pirms 5 mēnešiem
vecāks
revīzija
1f20308ff0
3 mainītis faili ar 22 papildinājumiem un 3 dzēšanām
  1. +0
    -3
      v5/gui.py
  2. +21
    -0
      v5/gui_test.py
  3. +1
    -0
      v5/main-gui.py

+ 0
- 3
v5/gui.py Parādīt failu

@@ -63,9 +63,6 @@ def gui_generateTilePositions(
return c
#}

# Assume window size is an integer multiple of cell size.
widthInCells = c.windowWidth / c.cellSize
heightInCells = c.windowHeight / c.cellSize
positions = gui_aux_cellPositions(c.playfieldSize)

ps = []


+ 21
- 0
v5/gui_test.py Parādīt failu

@@ -25,3 +25,24 @@ def test_gui_generateTextureDescriptions(
#}
return "ERR: gui_generateTextureDescriptions"
#}

def test_gui_generateTilePositions(
) -> str:
c = memory_createContext()

c.cellSize = 10
c.playfieldSize = 2
c.windowHeight = 200
c.windowWidth = 200
c.recentField = "windowWidth"

c = gui_generateTilePositions(c)
if (
c.recentField == "tilePositions" and
len(c.tilePositions) == 4 and
c.tilePositions[0][0] == 140
):
return "OK: gui_generateTilePositions"
#}
return "ERR: gui_generateTilePositions"
#}

+ 1
- 0
v5/main-gui.py Parādīt failu

@@ -52,6 +52,7 @@ print(cli_test_reportVictory())

print(test_gui_aux_cellPositions())
print(test_gui_generateTextureDescriptions())
print(test_gui_generateTilePositions())

ctrl = ctx_Controller(memory_createContext())
ctrl.registerFunctions([


Notiek ielāde…
Atcelt
Saglabāt