mirror of
https://github.com/maoakeEnterprise/amazing.git
synced 2026-04-28 16:04:35 +02:00
finish the mypy strict
This commit is contained in:
+10
-7
@@ -21,8 +21,6 @@ class MazeMLX:
|
|||||||
self.buf, self.bpp, self.size_line, self.format = (
|
self.buf, self.bpp, self.size_line, self.format = (
|
||||||
self.mlx.mlx_get_data_addr(self.img_ptr)
|
self.mlx.mlx_get_data_addr(self.img_ptr)
|
||||||
)
|
)
|
||||||
self.path_printer = None
|
|
||||||
self.generator = None
|
|
||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
self.mlx.mlx_destroy_image(self.mlx_ptr, self.img_ptr)
|
self.mlx.mlx_destroy_image(self.mlx_ptr, self.img_ptr)
|
||||||
@@ -245,16 +243,19 @@ class MazeMLX:
|
|||||||
self.put_block((x0, y0), (x1, y1), color)
|
self.put_block((x0, y0), (x1, y1), color)
|
||||||
|
|
||||||
def draw_image(self, amazing: AMazeIng) -> None:
|
def draw_image(self, amazing: AMazeIng) -> None:
|
||||||
|
maze = amazing.maze.get_maze()
|
||||||
if self.render_maze(amazing):
|
if self.render_maze(amazing):
|
||||||
if self.path_printer and self.print_path:
|
if self.print_path:
|
||||||
if self.render_path():
|
if self.render_path():
|
||||||
color = next(self.color_gen_ft)
|
color = next(self.color_gen_ft)
|
||||||
self.draw_ft(amazing.maze.get_maze(), color)
|
if maze is not None:
|
||||||
|
self.draw_ft(maze, color)
|
||||||
next(self.timer_gen)
|
next(self.timer_gen)
|
||||||
else:
|
else:
|
||||||
self.time_gen()
|
self.time_gen()
|
||||||
self.update_maze(amazing.maze.get_maze())
|
if maze is not None:
|
||||||
self.draw_ft(amazing.maze.get_maze())
|
self.update_maze(maze)
|
||||||
|
self.draw_ft(maze)
|
||||||
self.put_start_end(amazing)
|
self.put_start_end(amazing)
|
||||||
self.redraw_image()
|
self.redraw_image()
|
||||||
|
|
||||||
@@ -290,8 +291,10 @@ class MazeMLX:
|
|||||||
|
|
||||||
def render_maze(self, amazing: AMazeIng) -> bool:
|
def render_maze(self, amazing: AMazeIng) -> bool:
|
||||||
try:
|
try:
|
||||||
|
maze = amazing.maze.get_maze()
|
||||||
next(self.generator)
|
next(self.generator)
|
||||||
self.update_maze(amazing.maze.get_maze())
|
if maze is not None:
|
||||||
|
self.update_maze(maze)
|
||||||
return False
|
return False
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
pass
|
pass
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
WIDTH=15
|
WIDTH=10
|
||||||
HEIGHT=15
|
HEIGHT=10
|
||||||
ENTRY=1,1
|
ENTRY=1,1
|
||||||
EXIT=5,5
|
EXIT=5,5
|
||||||
OUTPUT_FILE=maze.txt
|
OUTPUT_FILE=maze.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user