class DijkstraMap(SourcedMap):
def __init__(self, *args, **kwargs):
+ # TODO: check potential optimizations:
+ # - do a first pass circling out from the center
+ # - somehow ignore tiles that have the lowest possible value (we can
+ # compare with a precalculated map for given starting position)
+ # - check if Python offers more efficient data structures to use here
+ # - shorten radius to nearest possible target
super().__init__(*args, **kwargs)
self.terrain = [255] * self.size_i
self[self.center] = 0