fix a few missing self attributes

This commit is contained in:
Maximilian Keßler 2023-03-18 10:17:09 +01:00
parent a90423e5c4
commit a056c83869
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -194,7 +194,7 @@ class GameState():
self.actions.append(Action(ActionType.Discard, target=card_idx)) self.actions.append(Action(ActionType.Discard, target=card_idx))
self.clues += 1 self.clues += 1
self.pace -= 1 self.pace -= 1
self.trash.append(instance.deck[card_idx]) self.trash.append(self.instance.deck[card_idx])
self.__replace(card_idx) self.__replace(card_idx)
self.__make_turn() self.__make_turn()
@ -209,6 +209,29 @@ class GameState():
) )
self.clues -= 1 self.clues -= 1
self.__make_turn() self.__make_turn()
# Forward some properties of the underlying instance
@property
def num_players(self):
return self.instance.num_players
@property
def num_suits(self):
return self.instance.num_suits
@property
def num_dark_suits(self):
return self.instance.num_dark_suits
@property
def deck(self):
return self.instance.deck
@property
def hand_size(self):
return self.instance.hand_size
# Properties of GameState # Properties of GameState
@ -248,8 +271,8 @@ class GameState():
) )
) )
return { return {
"deck": instance.deck, "deck": self.instance.deck,
"players": instance.players, "players": self.instance.player_names,
"actions": self.actions, "actions": self.actions,
"first_player": 0, "first_player": 0,
"options": { "options": {