Merge pull request #103 from eric-wieser/patch-1
Added `box.positions`, to complement `box.chunkPositions`.
This commit is contained in:
commit
16afdaffb8
9
box.py
9
box.py
@ -142,6 +142,15 @@ 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)
|
||||
|
Reference in New Issue
Block a user