projects
/
koperkapel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Final screenshots.
[koperkapel.git]
/
koperkapel
/
world.py
diff --git
a/koperkapel/world.py
b/koperkapel/world.py
index 5a22b04fdbefd21de586e0f8e8fc03cbd01091ef..a07b719a41a79e5882d8fcb7b2da03dfdb8bb7b9 100644
(file)
--- a/
koperkapel/world.py
+++ b/
koperkapel/world.py
@@
-23,9
+23,7
@@
class World:
state["roaches"] = [
build_roach(self, "roupert"),
]
state["roaches"] = [
build_roach(self, "roupert"),
]
- state["serums"] = [
- "smart", "strong", "fast",
- ]
+ state["serums"] = []
state["vehicles"] = {
"current": "walking",
"walking": {
state["vehicles"] = {
"current": "walking",
"walking": {
@@
-38,6
+36,9
@@
class World:
"roomba": {"seating": []},
"quadcopter": {"seating": []},
}
"roomba": {"seating": []},
"quadcopter": {"seating": []},
}
+ state["weapons"] = {
+ "current": "spit",
+ }
state["level"] = {
"name": "level1",
}
state["level"] = {
"name": "level1",
}
@@
-65,6
+66,11
@@
class World:
obj, key = self._get_obj(name)
obj.append(value)
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 _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 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")