Skip to content

Instantly share code, notes, and snippets.

@tt293
Last active April 13, 2022 05:27
Show Gist options
  • Save tt293/b7a85d362a1a8f46cfe481aa176d7849 to your computer and use it in GitHub Desktop.
Save tt293/b7a85d362a1a8f46cfe481aa176d7849 to your computer and use it in GitHub Desktop.
Abstract GameState class
class GameState(ABC):
@abstractmethod
def is_terminal(self) -> bool:
pass
@abstractmethod
def get_payoffs(self) -> List[int]:
pass
@abstractmethod
def get_actions(self, player: Player) -> List[Action]:
pass
@abstractmethod
def handle_action(self, player: Player, action: Action) -> GameState:
pass
@abstractmethod
def get_active_player(self) -> Player:
pass
@abstractmethod
def get_index(self, player: Player) -> int:
pass
@abstractmethod
def get_representation(self) -> str:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment