From 0a68c3d4221f7861eb0f07085872587af3b782e3 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sun, 27 May 2012 21:48:50 +0200 Subject: [PATCH 1/2] Added `box.positions`, to complement `box.chunkPositions`. --- box.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/box.py b/box.py index dd7f0ae..a43a06b 100644 --- a/box.py +++ b/box.py @@ -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) From 6eb40b1e0048676ea3970305657f32d84f3ef420 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 28 May 2012 00:02:54 +0200 Subject: [PATCH 2/2] Line wrapped for readability. Converted comment to docstring --- box.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/box.py b/box.py index a43a06b..3ba8704 100644 --- a/box.py +++ b/box.py @@ -144,8 +144,12 @@ class BoundingBox (object): @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)) + """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):