diff --git a/clash_royale/envs/game_engine/arena.py b/clash_royale/envs/game_engine/arena.py index 853a5b3..004f005 100644 --- a/clash_royale/envs/game_engine/arena.py +++ b/clash_royale/envs/game_engine/arena.py @@ -42,11 +42,11 @@ def __init__(self, width: int =8, height: int=18) -> None: def reset(self) -> None: pass - def step(self) -> None: + def step(self, frames: int=1) -> None: pass def get_entities(self) -> List[Entity]: - pass + return [] def play_card(self, x: int, y: int, card: Card) -> None: pass diff --git a/clash_royale/envs/game_engine/player.py b/clash_royale/envs/game_engine/player.py index 4bb8e85..d37a9ab 100644 --- a/clash_royale/envs/game_engine/player.py +++ b/clash_royale/envs/game_engine/player.py @@ -49,19 +49,19 @@ def get_pseudo_legal_cards(self) -> list[Card]: for card in self.hand: if card.elixir <= self.elixir: legal_cards.append(card) + return legal_cards - + 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 to better customize the elixir_rate that can vary depends on game modes. - """ self.elixir += (elixir_rate / self.fps) * frames - + def pop(self, card_index: int) -> None: """ diff --git a/clash_royale/envs/game_engine/struct.py b/clash_royale/envs/game_engine/struct.py index b04d177..4707e13 100644 --- a/clash_royale/envs/game_engine/struct.py +++ b/clash_royale/envs/game_engine/struct.py @@ -36,15 +36,16 @@ class DefaultScheduler(GameScheduler): """ Class for default 1v1 game scheduling """ + def elixir_rate(self) -> float: - pass + return 0 def game_state(self) -> int: """ Function to get current game state: ex: Game is over, double elixir, overtime, etc. """ - pass + return 0