Skip to content

Commit

Permalink
removed assert space
Browse files Browse the repository at this point in the history
  • Loading branch information
lunathanael committed Mar 11, 2024
1 parent 76794d6 commit 901638a
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 @@ -99,17 +99,17 @@ def apply(self, player_id: int, action: Tuple[int, int, int] | None) -> None:
if action is None:
return

assert(action[0] >= 0 and action[0] < self.width)
assert(action[1] >= 0 and action[1] < self.height)
assert(action[2] >= 0 and action[2] < 4)
assert action[0] >= 0 and action[0] < self.width
assert action[1] >= 0 and action[1] < self.height
assert action[2] >= 0 and action[2] < 4

if player_id == 0:
curr_player = self.player1
else:
curr_player = self.player2

card: Card = curr_player.hand[action[2]]
assert(card.elixir <= curr_player.elixir)
assert card.elixir <= curr_player.elixir

self.arena.play_card(action[0], action[1], card)
curr_player.play_card(action[2])
Expand All @@ -121,7 +121,7 @@ def step(self, frames: int=1) -> None:
"""

# update elixir first, order TBD.
elixir_rate = self.game_scheduler.elixir_rate()
elixir_rate: float = self.game_scheduler.elixir_rate()
self.player1.step(elixir_rate, frames)
self.player2.step(elixir_rate, frames)

Expand Down

0 comments on commit 901638a

Please sign in to comment.