Add basic turnip life-cycle
[tabakrolletjie.git] / tabakrolletjie / gamestate.py
index 14da6d880f84d5e562cd30867d005b29fa6d7403..03b5f23a1d424fe937124b0b1f8390ab86cfc58c 100644 (file)
@@ -7,11 +7,34 @@ class GameState(object):
     def __init__(self):
         self._state = {
             "station": None,
+            "turnips": [],
         }
+        self.harvested = 0
 
     @property
     def station(self):
         return self._state["station"]
 
+    @property
+    def turnips(self):
+        return self._state["turnips"]
+
+    @turnips.setter
+    def turnips(self, turnip_list):
+        self._state["turnips"] = turnip_list
+
+    @property
+    def seeds(self):
+        if 'seeds' in self._state:
+            return self._state['seeds']
+        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
+
+    @seeds.setter
+    def seeds(self, value):
+        self._state['seeds'] = value
+
     def load_station(self, station):
         self._state["station"] = loader.load_station(station)