2 The current game state.
7 from naja.gameboard import GameBoard
8 from naja.resources import resources
11 def load_location_deck(name):
12 with resources.get_file('location_decks', '%s.yaml' % (name,)) as deck_fp:
13 return yaml.safe_load(deck_fp)
16 class GameState(object):
21 def __init__(self, gameboard):
22 self.gameboard = gameboard
25 def new(cls, deck='standard', **kw):
26 locations_deck = load_location_deck(deck)
27 return cls(GameBoard.new_game(locations_deck['cards'], **kw))
31 return cls(GameBoard.import_game(data))
35 return self.gameboard.player
38 def board_locations(self):
39 return self.gameboard.board_locations