home · contact · privacy
Lots of refactoring to enable SAVE command.
[plomrogue2-experiments] / client-curses.py
index 9a8178d9d133ad5b366a43819aa5fbefd5a2588e..ea5dcf32f8ad34d9281de174566fe64f3a20601f 100755 (executable)
@@ -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)