home · contact · privacy
Fix visibility tests on annotation, volume algorithm.
[plomrogue2] / plomrogue / mapping.py
index 4f2f5f9e3b7c465bc05ed1409af9b318befb8d71..58809ef8a2764cf7e3212e59687ae9e938013f86 100644 (file)
@@ -119,6 +119,12 @@ class Map():
         else:
             self.terrain[pos_i] = c
 
+    def __iter__(self):
+        """Iterate over YX position coordinates."""
+        for y in range(self.size.y):
+            for x in range(self.size.x):
+                yield YX(y, x)
+
     @property
     def size_i(self):
         return self.size.y * self.size.x
@@ -145,11 +151,12 @@ class Map():
 
 
 class FovMap(Map):
+    # FIXME: player visibility asymmetrical (A can see B when B can't see A)
 
     def __init__(self, source_map, center):
         self.source_map = source_map
         self.size = self.source_map.size
-        self.fov_radius = (self.size.y / 2) - 0.5
+        self.fov_radius = 12 # (self.size.y / 2) - 0.5
         self.start_indented = True  #source_map.start_indented
         self.terrain = '?' * self.size_i
         self.center = center