Fix gamestate setup.
[naja.git] / naja / gamestate.py
1 """
2 The current game state.
3 """
4
5 from naja.constants import BITS
6 from naja.gameboard import GameBoard
7
8
9 class GameState(object):
10     """
11     Naja game state.
12     """
13
14     INITIAL_BITS = (
15         BITS.NORTH | BITS.SOUTH |
16         BITS.EAST | BITS.WEST
17     )
18     MAX_HEALTH = 4
19     WINS_REQUIRED = 4
20
21     def __init__(self):
22         self.gameboard = GameBoard.new_game(
23             initial_bits=self.INITIAL_BITS,
24             initial_pos=(2, 2),
25             max_health=self.MAX_HEALTH,
26             wins_required=self.WINS_REQUIRED,
27             locations_definition=[])  # TODO: we will need some of these :)
28
29     @property
30     def player(self):
31         return self.gameboard.player