X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=koperkapel%2Fworld.py;h=a07b719a41a79e5882d8fcb7b2da03dfdb8bb7b9;hb=5cd50a8c6ecf77a17eab6dcda0425501772caaaf;hp=5a22b04fdbefd21de586e0f8e8fc03cbd01091ef;hpb=c0c4478e4a5748feb30c0923103d90a9ecc23063;p=koperkapel.git diff --git a/koperkapel/world.py b/koperkapel/world.py index 5a22b04..a07b719 100644 --- a/koperkapel/world.py +++ b/koperkapel/world.py @@ -23,9 +23,7 @@ class World: state["roaches"] = [ build_roach(self, "roupert"), ] - state["serums"] = [ - "smart", "strong", "fast", - ] + state["serums"] = [] state["vehicles"] = { "current": "walking", "walking": { @@ -38,6 +36,9 @@ class World: "roomba": {"seating": []}, "quadcopter": {"seating": []}, } + state["weapons"] = { + "current": "spit", + } state["level"] = { "name": "level1", } @@ -65,6 +66,11 @@ class World: 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() @@ -155,3 +161,6 @@ class WorldListProxy(WorldBaseProxy): 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")