Oh yeah, we're using a AttrDict thing, aren't we?
[naja.git] / naja / gamestate.py
1 """
2 The current game state.
3 """
4
5 from naja.gameboard import GameBoard
6 from naja.constants import BITS
7
8
9 class GameState(object):
10     """
11     Naja game state.
12     """
13
14     def __init__(self):
15         # This is a very simple deck to allow testing more drawing logic
16         # on tiles. These will need to be replaced with better stuff.
17         self.gameboard = GameBoard.new_game(
18             locations_definition=[
19                 {'actions': []},
20                 {'actions': [{'required_bits': [BITS.CYAN],
21                               'action_class': 'DoNothing'}]},
22                 {'actions': [{'required_bits': [BITS.YELLOW],
23                               'action_class': 'DoNothing'}]},
24                 {'actions': [{'required_bits': [BITS.YELLOW, BITS.MAGENTA],
25                               'action_class': 'DoNothing'}]},
26                 ])
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