Skip to content

Commit

Permalink
updated game_scheduler type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
lunathanael committed Mar 12, 2024
1 parent 4f88b04 commit f9d0aea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clash_royale/envs/game_engine/game_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self,
self.player2: Player = Player(deck2, fps)

self.scheduler: Scheduler = Scheduler(fps) # counting frames
self.game_scheduler: GameScheduler = DefaultScheduler(self.scheduler) # determining elixir etc.
self.game_scheduler: DefaultScheduler = DefaultScheduler(self.scheduler) # determining elixir etc.

def reset(self) -> None:
"""
Expand Down Expand Up @@ -156,13 +156,13 @@ def is_terminal(self) -> bool:
"""
if self.game_scheduler.is_game_over():
return True

if self.game_scheduler.is_overtime():
player1_val = self.arena.tower_count(0)
player2_val = self.arena.tower_count(1)
player1_val: int = self.arena.tower_count(0)
player2_val: int = self.arena.tower_count(1)
if player1_val != player2_val:
return True

return False

def terminal_value(self) -> int:
Expand Down

0 comments on commit f9d0aea

Please sign in to comment.