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)
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)
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
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