home · contact · privacy
Add basic save file mechanism.
[plomrogue2-experiments] / new2 / plomrogue / io.py
index 12e74500eff1b7582d2a6a81601696e8076d4833..2283a986d10717511778b1d79aa5dca4b4919557 100644 (file)
@@ -4,17 +4,18 @@ import queue
 
 class GameIO():
 
-    def __init__(self, game):
+    def __init__(self, game, save_file='savefile'):
         from plomrogue.parser import Parser
         self.clients = {}
         self.parser = Parser(game)
         self.game = game
+        self.save_file = save_file
 
     def loop(self, q):
         """Handle commands coming through queue q, run game, send results back."""
         while True:
             try:
-                command, connection_id = q.get(timeout=1)
+                command, connection_id = q.get(timeout=0.001)
                 self.handle_input(connection_id, command)
             except queue.Empty:
                 self.game.run_tick()