Skip to content

Commit

Permalink
finished game_engine linting
Browse files Browse the repository at this point in the history
  • Loading branch information
lunathanael committed Mar 12, 2024
1 parent f9d0aea commit ac5f441
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions clash_royale/envs/game_engine/arena.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ def get_placement_mask(self) -> npt.NDArray[bool]:

def tower_count(self, player_id: int) -> int:
return 0

def lowest_tower_health(self, player_id: int) -> int:
return 0
9 changes: 3 additions & 6 deletions clash_royale/envs/game_engine/game_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,17 @@ def terminal_value(self) -> int:
"""
Returns side won, otherwise returns -1.
"""
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:
player1_val = self.arena.lowest_tower_health(0)
player2_val = self.arena.lowest_tower_health(1)

if player1_val > player2_val:
return 1

if player2_val > player1_val:
return 0

if player1_val == player2_val:
return -1



0 comments on commit ac5f441

Please sign in to comment.