home
·
contact
·
privacy
projects
/
plomrogue2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix visibility tests on annotation, volume algorithm.
[plomrogue2]
/
plomrogue
/
mapping.py
diff --git
a/plomrogue/mapping.py
b/plomrogue/mapping.py
index 10f9b70a5c1dbe9975e11d4233ba56aad80368d6..58809ef8a2764cf7e3212e59687ae9e938013f86 100644
(file)
--- a/
plomrogue/mapping.py
+++ b/
plomrogue/mapping.py
@@
-119,6
+119,12
@@
class Map():
else:
self.terrain[pos_i] = c
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
@property
def size_i(self):
return self.size.y * self.size.x
@@
-145,6
+151,7
@@
class Map():
class FovMap(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
def __init__(self, source_map, center):
self.source_map = source_map