Add days to gamestate and day screen display
[tabakrolletjie.git] / tabakrolletjie / gamestate.py
index 03b5f23a1d424fe937124b0b1f8390ab86cfc58c..4ce92e832007db534b6af5422b7be2cc4d799d9d 100644 (file)
@@ -1,7 +1,5 @@
 """ The game state. """
 
-from .loader import loader
-
 
 class GameState(object):
     def __init__(self):
@@ -10,6 +8,8 @@ class GameState(object):
             "turnips": [],
         }
         self.harvested = 0
+        self.eaten = 0
+        self.days = 0
 
     @property
     def station(self):
@@ -27,7 +27,8 @@ class GameState(object):
     def seeds(self):
         if 'seeds' in self._state:
             return self._state['seeds']
-        elif self._state["station"] and 'seeds' in self._state["station"]["config"]:
+        elif (self._state["station"] and
+                'seeds' in self._state["station"]["config"]):
             self._state['seeds'] = self._state["station"]["config"]["seeds"]
             return self._state['seeds']
         return 0
@@ -36,5 +37,8 @@ class GameState(object):
     def seeds(self, value):
         self._state['seeds'] = value
 
-    def load_station(self, station):
-        self._state["station"] = loader.load_station(station)
+    def set_station(self, station):
+        self._state["station"] = station
+
+    def get_spawn_positions(self):
+        return self._state["station"]["config"]["spawn positions"]