1 """ The game state. """
4 class GameState(object):
18 return self._state["station"]
22 return self._state["turnips"]
25 def turnips(self, turnip_list):
26 self._state["turnips"] = turnip_list
30 if self._state["seeds"] is None:
31 if (self._state["station"] and
32 "seeds" in self._state["station"]["config"]):
33 self._state["seeds"] = (
34 self._state["station"]["config"]["seeds"])
36 self._state["seeds"] = 0
37 return self._state["seeds"]
40 def seeds(self, value):
41 self._state['seeds'] = value
43 def set_station(self, station):
44 self._state["station"] = station
45 self._state["turnips"] = []
46 self._state["seeds"] = None
49 def get_spawn_positions(self):
50 return self._state["station"]["config"]["spawn positions"]
53 def turnip_target(self):
54 return self._state["station"]["config"]["turnip target"]
56 def update_lights(self, lights):
57 self._state["station"]["lights"] = lights.serialize_lights()