Move player defaults into constants.
[naja.git] / naja / gameboard.py
index 5ec61507c7e31a5b10b7c28780b427414e97c462..5728d5d0f28535abfeadcbb5ab3f98c3a24b74b7 100644 (file)
@@ -1,6 +1,7 @@
 from random import choice
 
-from naja.constants import BITS, DIRECTION_BITS, CONDITION_BITS
+from naja.constants import(
+    BITS, DIRECTION_BITS, CONDITION_BITS, PLAYER_DEFAULTS)
 from naja.player import Player
 from naja import actions
 
@@ -20,8 +21,11 @@ class GameBoard(object):
         self.board_locations = board_locations
 
     @classmethod
-    def new_game(cls, initial_bits, initial_pos, max_health, wins_required,
-                 locations_definition):
+    def new_game(cls, locations_definition,
+                 initial_bits=PLAYER_DEFAULTS.INITIAL_BITS,
+                 initial_pos=PLAYER_DEFAULTS.INITIAL_POS,
+                 max_health=PLAYER_DEFAULTS.MAX_HEALTH,
+                 wins_required=PLAYER_DEFAULTS.WINS_REQUIRED):
         state = {
             'max_health': max_health,
             'health': max_health,