Start of standard deck.
[naja.git] / naja / gamestate.py
1 """
2 The current game state.
3 """
4
5 import yaml
6
7 from naja.gameboard import GameBoard
8 from naja.resources import resources
9
10
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)
14
15
16 class GameState(object):
17     """
18     Naja game state.
19     """
20
21     def __init__(self):
22         # This is a very simple deck to allow testing more drawing logic
23         # on tiles. These will need to be replaced with better stuff.
24         locations_deck = load_location_deck('standard')
25         # locations_deck = load_location_deck('test')
26         self.gameboard = GameBoard.new_game(locations_deck['cards'])
27
28     @property
29     def player(self):
30         return self.gameboard.player
31
32     @property
33     def board_locations(self):
34         return self.gameboard.board_locations