X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=client-curses.py;h=a8add972df17428ae24e9ae87be7699353c6cc13;hb=77b74e4142ae2e8a3a5637af9856e26d86f8ec76;hp=9a8178d9d133ad5b366a43819aa5fbefd5a2588e;hpb=6237227d771fa5b4cfbcdffb8c74457e2d406bb1;p=plomrogue2-experiments diff --git a/client-curses.py b/client-curses.py index 9a8178d..a8add97 100755 --- a/client-curses.py +++ b/client-curses.py @@ -77,7 +77,7 @@ class MapHex(Map): return map_lines -map_manager = game_common.MapManager(globals()) +map_manager = game_common.MapManager((MapHex, MapSquare)) class World(game_common.World): @@ -128,12 +128,12 @@ class Game(game_common.CommonCommandsMixin): self.do_quit = True return try: - command = self.parser.parse(msg) + command, args = self.parser.parse(msg) if command is None: self.log('UNHANDLED INPUT: ' + msg) self.to_update['log'] = True else: - command() + command(*args) except ArgError as e: self.log('ARGUMENT ERROR: ' + msg + '\n' + str(e)) self.to_update['log'] = True @@ -161,13 +161,13 @@ class Game(game_common.CommonCommandsMixin): pass cmd_TURN_FINISHED.argtypes = 'int:nonneg' - def cmd_NEW_TURN(self, n): + def cmd_TURN(self, n): """Set self.turn to n, empty self.things.""" self.world.turn = n self.world.things = [] self.to_update['turn'] = False self.to_update['map'] = False - cmd_NEW_TURN.argtypes = 'int:nonneg' + cmd_TURN.argtypes = 'int:nonneg' def cmd_VISIBLE_MAP_LINE(self, y, terrain_line): self.world.map_.set_line(y, terrain_line)