2 The current game state.
11 from naja.gameboard import GameBoard
12 from naja.resources import resources
15 def load_location_deck(name):
17 with resources.get_file('location_decks', '%s.yaml' % name) as deck_fp:
18 return yaml.safe_load(deck_fp)
20 with resources.get_file('location_decks', '%s.json' % name) as deck_fp:
21 return json.load(deck_fp)
24 class GameState(object):
29 def __init__(self, gameboard):
30 self.gameboard = gameboard
33 def new(cls, deck='standard', **kw):
34 deck = load_location_deck(deck)
35 return cls(GameBoard.new_game(deck, **kw))
39 return cls(GameBoard.import_game(data))
43 return self.gameboard.player
46 def board_locations(self):
47 return self.gameboard.board_locations