def filter_out_loc(self, loc):
old_best = self.get_best_claim()
copy = list(self.heap)
for claim in self.heap:
# this is a problem for roots?
if loc is claim.get_parent().loc:
copy.remove(claim)
claim.set_heap(None)
if loc.gameMap().getLocation(self.site().loc, self.dir) == loc:
self.dir = None
self.heap = copy
heapq.heapify(self.heap)
self.check_heap(old_best)
# logger.debug("Removed all children from %s that would come to %s" % (self.site().loc, loc ) )
评论列表
文章目录