fix a few missing self attributes
This commit is contained in:
parent
a90423e5c4
commit
a056c83869
1 changed files with 26 additions and 3 deletions
29
hanabi.py
29
hanabi.py
|
@ -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()
|
||||||
|
|
||||||
|
@ -211,6 +211,29 @@ class GameState():
|
||||||
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
|
||||||
|
|
||||||
def is_over(self):
|
def is_over(self):
|
||||||
|
@ -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": {
|
||||||
|
|
Loading…
Reference in a new issue