X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=inline;f=new%2Fexample_client.py;h=19538161a5b3d575df3d80fe9cfe77c42f3b2f26;hb=d2324a2fcb0d4562ff2da13bb7f92f291589d6b4;hp=27960057766110908af16a304b7b91d2a63dd256;hpb=6e960c317711557fdd5e52e5e11333df69a99624;p=plomrogue2-experiments
diff --git a/new/example_client.py b/new/example_client.py
index 2796005..1953816 100755
--- a/new/example_client.py
+++ b/new/example_client.py
@@ -79,6 +79,7 @@ cmd_TURN_FINISHED.argtypes = 'int:nonneg'
def cmd_TURN(game, n):
"""Set game.turn to n, empty game.things."""
+ game.log_text = ''
game.turn = n
game.things = []
game.pickable_items[:] = []
@@ -102,13 +103,13 @@ def cmd_GAME_STATE_COMPLETE(game):
def cmd_THING_TYPE(game, i, type_):
- t = game.get_thing(i)
+ t = game.get_thing(i, create_unfound=True)
t.type_ = type_
cmd_THING_TYPE.argtypes = 'int:nonneg string'
def cmd_THING_POS(game, i, yx):
- t = game.get_thing(i)
+ t = game.get_thing(i,create_unfound=True)
t.position = YX(0,0), yx
cmd_THING_POS.argtypes = 'int:nonneg yx_tuple:nonneg'
@@ -158,7 +159,7 @@ class Game(GameBase):
@property
def player(self):
- return self.get_thing(self.player_id)
+ return self.get_thing(self.player_id, create_unfound=False)
def get_command(self, command_name):
from functools import partial
@@ -369,7 +370,7 @@ class ItemsSelectorWidget(Widget):
counter = 0
for id_ in self.selection:
pointer = '*' if counter == self.tui.item_pointer else ' '
- t = self.tui.game.get_thing(id_)
+ t = self.tui.game.get_thing(id_, create_unfound=False)
lines += ['%s %s' % (pointer, t.type_)]
counter += 1
line_width = self.size.x