Skip to content

Commit

Permalink
added extra check
Browse files Browse the repository at this point in the history
  • Loading branch information
lunathanael committed Mar 12, 2024
1 parent ea61435 commit dea1078
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clash_royale/envs/game_engine/game_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def terminal_value(self) -> int:
"""
Returns side won, otherwise returns -1.
"""

player1_val: int = self.arena.tower_count(0)
player2_val: int = self.arena.tower_count(1)
if player1_val == player2_val:
Expand Down
5 changes: 3 additions & 2 deletions clash_royale/envs/game_engine/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def step(self,
elixir_rate: float,
frames: int=1) -> None:
"""
Called with the value of elixir_rate and frame to update the elixir of player after 'frame' number of frames
Called with the value of elixir_rate and frame to update the elixir of player
to better customize the elixir_rate that can vary depends on game modes.
"""

Expand All @@ -72,7 +72,8 @@ def pop(self, card_index: int) -> None:
"""

assert(card_index < 4)
assert card_index >= 0 and card_index < 4

self.deck.put(self.hand[card_index], block = False)
self.hand[card_index] = self.next
self.next: Card = self.deck.get(block = False)
Expand Down

0 comments on commit dea1078

Please sign in to comment.