home · contact · privacy
Introduce map geometry.
[plomrogue2-experiments] / new2 / plomrogue / game.py
index c8c2f3cbf9fae868e15eaa0bfdba13a7233dbe8a..47e08fb93c6257b0148cbc4768b837c4d85a37cb 100755 (executable)
@@ -4,6 +4,7 @@ from plomrogue.commands import cmd_ALL, cmd_LOGIN, cmd_QUERY
 from plomrogue.io import GameIO
 from plomrogue.misc import quote
 from plomrogue.things import Thing, ThingPlayer 
+from plomrogue.mapping import MapGeometrySquare
 
 
 
@@ -36,14 +37,17 @@ class Game(GameBase):
         self.io = GameIO(self)
         self.tasks = {'WAIT': Task_WAIT,
                       'MOVE': Task_MOVE}
-        self.commands = {'QUERY': cmd_QUERY, 'ALL': cmd_ALL, 'LOGIN': cmd_LOGIN}
+        self.map_geometry = MapGeometrySquare()
+        self.commands = {'QUERY': cmd_QUERY,
+                         'ALL': cmd_ALL,
+                         'LOGIN': cmd_LOGIN}
         self.thing_type = Thing
         self.thing_types = {'player': ThingPlayer}
         self.sessions = {}
 
     def get_string_options(self, string_option_type):
         if string_option_type == 'direction':
-            return ['UP', 'DOWN', 'LEFT', 'RIGHT'] 
+            return self.map_geometry.get_directions()
         return None
 
     def send_gamestate(self, connection_id=None):