diff --git a/src/kesslergame/controller.py b/src/kesslergame/controller.py index 28d31e8..28cc1b3 100644 --- a/src/kesslergame/controller.py +++ b/src/kesslergame/controller.py @@ -14,7 +14,7 @@ class KesslerController: game_state dictionary. This action method then sets the thrust, turn_rate, and fire commands on the ship object. """ - def actions(self, ship_state: Dict[str, Any], game_state: type[immutabledict[str, Any]]) -> Tuple[float, float, bool, bool]: + def actions(self, ship_state: Dict[str, Any], game_state: immutabledict[Any, Any]) -> Tuple[float, float, bool, bool]: """ Method processed each time step by this controller. """ diff --git a/src/kesslergame/controller_gamepad.py b/src/kesslergame/controller_gamepad.py index 8c7963f..ef4280f 100644 --- a/src/kesslergame/controller_gamepad.py +++ b/src/kesslergame/controller_gamepad.py @@ -6,7 +6,7 @@ import math import threading import time - +from immutabledict import immutabledict class GamepadController(KesslerController): @@ -18,7 +18,7 @@ def __init__(self) -> None: # can only toggle pausing every 0.5 seconds self.pause_time_buffer = 0.5 - def actions(self, ship_state: Dict[str, Any], game_state: Dict[str, Any]) -> Tuple[float, float, bool, bool]: + def actions(self, ship_state: Dict[str, Any], game_state: immutabledict[Any, Any]) -> Tuple[float, float, bool, bool]: """ Read in the current gamepad state, and create the appropriate actions """ diff --git a/src/kesslergame/kessler_game.py b/src/kesslergame/kessler_game.py index 3c11ff5..93f3557 100644 --- a/src/kesslergame/kessler_game.py +++ b/src/kesslergame/kessler_game.py @@ -120,7 +120,7 @@ def run(self, scenario: Scenario, controllers: List[KesslerController]) -> Tuple liveships = [ship for ship in ships if ship.alive] # Generate game_state info to send to controllers - game_state = immutabledict({ + game_state: immutabledict = immutabledict({ 'asteroids': [asteroid.state for asteroid in asteroids], 'ships': [ship.state for ship in liveships], 'bullets': [bullet.state for bullet in bullets],