X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=client.py;h=80cac96aab380849a29c4e54edb6cb5c5bc86579;hb=827134a13175939231b85fbc159c013e0f024e78;hp=0a25e4513bd0687b5731651b40de51bb585ec125;hpb=59cd3d03e10e86125daed00e8d1b5576575ead1c;p=plomrogue2-experiments diff --git a/client.py b/client.py index 0a25e45..80cac96 100755 --- a/client.py +++ b/client.py @@ -34,6 +34,10 @@ class Game(Commander): self.world.things = [] cmd_NEW_TURN.argtypes = 'int:nonneg' + def cmd_VISIBLE_MAP_LINE(self, y, terrain_line): + self.world.map_.set_line(y, terrain_line) + cmd_VISIBLE_MAP_LINE.argtypes = 'int:nonneg string' + class WidgetManager: @@ -50,13 +54,13 @@ class WidgetManager: self.top = urwid.Filler(widget_pile, valign='top') def draw_map(self): - """Draw map view from .game.terrain_map, .game.things.""" + """Draw map view from .game.map_.terrain, .game.things.""" map_lines = [] - map_size = len(self.game.world.terrain_map) + map_size = len(self.game.world.map_.terrain) start_cut = 0 while start_cut < map_size: - limit = start_cut + self.game.world.map_size[1] - map_lines += [self.game.world.terrain_map[start_cut:limit]] + limit = start_cut + self.game.world.map_.size[1] + map_lines += [self.game.world.map_.terrain[start_cut:limit]] start_cut = limit for t in self.game.world.things: line_as_list = list(map_lines[t.position[0]])