]> Untitled Git - axy/ft/pacman.git/commitdiff
Fixups
authorAxy <gilliardmarthey.axel@gmail.com>
Thu, 24 Sep 2026 21:32:42 +0000 (23:32 +0200)
committerAxy <gilliardmarthey.axel@gmail.com>
Thu, 24 Sep 2026 21:32:42 +0000 (23:32 +0200)
src/pacman/ecs/__init__.py
src/pacman/ecs/hierarchy.py
src/pacman/ecs/world.py

index 92a053e5fc1b010e85ac408307316d9c957f2a46..7b72260adc629c882bb04d6479f2e3e188593fe5 100644 (file)
@@ -27,11 +27,14 @@ from pacman.ecs.world import (
     Resource,
     Systems,
     World,
-    WorldIsInit,
     WorldShouldExit,
 )
 
 
+class WorldIsInit(Resource):
+    pass
+
+
 def run_startup(world: World, _: Not[WorldIsInit]) -> None:
     world.tick(StartupSchedule)
     world.spawn(WorldIsInit, WorldIsInit())
index fdaaa29dc5e2587c24742ca7b55b82678f7a1428..30ca1fd403adf623051336f7892b16d1e807a06f 100644 (file)
@@ -1,5 +1,5 @@
 from collections.abc import Callable, Generator, Iterable
-from typing import cast, get_args, override
+from typing import Self, cast, get_args, override
 
 from pacman.ecs.world import Component, Entity, FromWorld, World
 
index 9b1014c65ddd2df824ed0d55352b4c8ca42d5154..59d552a3e5735f878863b5b227d774c6098d550b 100644 (file)
@@ -850,7 +850,7 @@ class World(FromWorld):
         return self
 
     def run_main(self) -> None:
-        self.run(MainSchedule, self.add_raw_system(should_exit, lambda: False))
+        self.run(MainSchedule, self.add_raw_system(should_exit))
 
 
 _order_groups: int = 0
@@ -905,13 +905,9 @@ class Systems:
         return label
 
 
-class WorldIsInit(Resource):
-    pass
-
-
 class WorldShouldExit(Resource):
     pass
 
 
-def should_exit(_: WorldShouldExit) -> bool:
-    return True
+def should_exit(e: Maybe[WorldShouldExit]) -> bool:
+    return e.v is not None