Added box.positions, to complement box.chunkPositions.

This commit is contained in:
Eric Wieser 2012-05-27 21:48:50 +02:00
parent 253597f0f2
commit 0a68c3d422

5
box.py
View File

@ -142,6 +142,11 @@ class BoundingBox (object):
#iterate through all of the chunk positions within this selection box
return itertools.product(xrange(self.mincx, self.maxcx), xrange(self.mincz, self.maxcz))
@property
def positions(self):
#iterate through all of the positions within this selection box
return itertools.product(xrange(self.minx, self.maxx), xrange(self.miny, self.maxy), xrange(self.minz, self.maxz))
@property
def chunkCount(self):
return (self.maxcx - self.mincx) * (self.maxcz - self.mincz)