state["roaches"] = [
build_roach(self, "roupert"),
]
- state["serums"] = [
- "smart", "strong", "fast",
- ]
+ state["serums"] = []
state["vehicles"] = {
"current": "walking",
"walking": {
"roomba": {"seating": []},
"quadcopter": {"seating": []},
}
+ state["weapons"] = {
+ "current": "spit",
+ }
state["level"] = {
"name": "level1",
}
obj, key = self._get_obj(name)
obj.append(value)
+ def _apply_pop(self, action, updates):
+ for name, pos in updates.items():
+ obj, key = self._get_obj(name)
+ obj.pop(pos)
+
def _apply_reset(self, action):
self._state = self._build_initial_state()
def append(self, value):
self._top._record_change(self._prefix, value, action="append")
+
+ def pop(self, pos=0):
+ self._top._record_change(self._prefix, pos, action="pop")