home · contact · privacy
Improve MapFovHex comments, variable names, ideas; add MapFovSquare.
[plomrogue2-experiments] / server_ / game.py
index 3b3eb0844cc7d527c95eed54282db4799c0ecff7..8068556ca89521f59648ad80afeae73ebee8e1a3 100644 (file)
@@ -127,11 +127,7 @@ class Thing(game_common.Thing):
     def get_stencil(self):
         if self._stencil is not None:
             return self._stencil
-        m = self.world.map_.new_from_shape('?')
-        for pos in m:
-            if pos == self.position or m.are_neighbors(pos, self.position):
-                m[pos] = '.'
-        self._stencil = m
+        self._stencil = self.world.map_.get_fov_map(self.position)
         return self._stencil
 
     def get_visible_map(self):
@@ -163,7 +159,6 @@ class Game(game_common.CommonCommandsMixin):
 
     def __init__(self, game_file_name):
         import server_.io
-        #self.get_map_class = server_.map_.get_map_class
         self.map_manager = server_.map_.map_manager
         self.world = World(self)
         self.io = server_.io.GameIO(game_file_name, self)
@@ -181,8 +176,8 @@ class Game(game_common.CommonCommandsMixin):
             return 'Y:' + str(tuple_[0]) + ',X:' + str(tuple_[1])
 
         self.io.send('NEW_TURN ' + str(self.world.turn))
-        grid = self.world.map_.__class__.__name__[3:]
-        self.io.send('MAP ' + grid +' ' + stringify_yx(self.world.map_.size))
+        self.io.send('MAP ' + self.world.map_.geometry +\
+                     ' ' + stringify_yx(self.world.map_.size))
         visible_map = self.world.get_player().get_visible_map()
         for y, line in visible_map.lines():
             self.io.send('VISIBLE_MAP_LINE %5s %s' % (y, self.io.quote(line)))