self._state = {
"station": None,
"turnips": [],
+ "seeds": None,
}
self.harvested = 0
self.eaten = 0
@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
+ 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"]
+ else:
+ self._state["seeds"] = 0
+ return self._state["seeds"]
@seeds.setter
def seeds(self, value):
def set_station(self, station):
self._state["station"] = station
+ self._state["turnips"] = []
+ self._state["seeds"] = None
def get_spawn_positions(self):
return self._state["station"]["config"]["spawn positions"]