X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=tabakrolletjie%2Fgamestate.py;h=6f6725b8e0bda36ef5a031946306194d0496b0e2;hb=30bbdf89429d8669ff1b595171a2a956bed7d377;hp=27762a6d7e086c3dae50bff4226cfe4ee085708a;hpb=0af42efcd7671a3980261c05890aa2f5c0ca2c9b;p=tabakrolletjie.git diff --git a/tabakrolletjie/gamestate.py b/tabakrolletjie/gamestate.py index 27762a6..6f6725b 100644 --- a/tabakrolletjie/gamestate.py +++ b/tabakrolletjie/gamestate.py @@ -11,6 +11,7 @@ class GameState(object): self.harvested = 0 self.eaten = 0 self.days = 0 + self.resistances = {} @property def station(self): @@ -28,8 +29,9 @@ class GameState(object): def seeds(self): if self._state["seeds"] is None: if (self._state["station"] and - "seeds" in self._state["station"]["config"]): - self._state["seeds"] = self._state["station"]["config"]["seeds"] + "seeds" in self._state["station"]["config"]): + self._state["seeds"] = ( + self._state["station"]["config"]["seeds"]) else: self._state["seeds"] = 0 return self._state["seeds"] @@ -42,9 +44,14 @@ class GameState(object): self._state["station"] = station self._state["turnips"] = [] self._state["seeds"] = None + self.resistances = {} def get_spawn_positions(self): return self._state["station"]["config"]["spawn positions"] - def get_target(self): + @property + def turnip_target(self): return self._state["station"]["config"]["turnip target"] + + def update_lights(self, lights): + self._state["station"]["lights"] = lights.serialize_lights()