示例#1
0
 def floodFill(self, tile, start):
     (x, y) = start
     x = x / blocksize
     y = y / blocksize
     self.visited = [(x, y)]
     self.BFSQueue.reset()
     floodArea = misc.flatten(self.floodFillBFS((x, y)))
     floodArea = list(set(floodArea))
     for entry in floodArea:
         (x, y) = entry
         self.place(x, y, tile)
示例#2
0
 def floodFill(self, tile, start):
     (x,y) = start
     x = x / blocksize
     y = y / blocksize
     self.visited = [ (x,y) ]
     self.BFSQueue.reset()
     floodArea = misc.flatten( self.floodFillBFS( (x,y) ) )
     floodArea = list( set(floodArea) )
     for entry in floodArea:
         (x,y) = entry
         self.place(x, y, tile)
示例#3
0
 def getLitTiles(self, l):
     (px, py) = self.playerXY
     self.BFSQueue.reset()
     self.visited = []
     if self.type == 'cave':
         self.getPPOV(px, py, l)
         #litTiles = misc.flatten( self.minBFS( (px,py) ) )
         return self.visited
     else:
         self.getPPOV(px, py, l)
         #litTiles = misc.flatten( self.minBFS( (px,py) ) )
         return self.visited
         litTiles = misc.flatten( self.litBFS( (px,py) ) )
     litTiles = list( set( litTiles) )
     self.litTiles = litTiles
     return litTiles
示例#4
0
 def getLitTiles(self, l):
     (px, py) = self.playerXY
     self.BFSQueue.reset()
     self.visited = []
     if self.type == 'cave':
         self.getPPOV(px, py, l)
         #litTiles = misc.flatten( self.minBFS( (px,py) ) )
         return self.visited
     else:
         self.getPPOV(px, py, l)
         #litTiles = misc.flatten( self.minBFS( (px,py) ) )
         return self.visited
         litTiles = misc.flatten(self.litBFS((px, py)))
     litTiles = list(set(litTiles))
     self.litTiles = litTiles
     return litTiles