code: def distance_to(self, p: Union["Unit", Point2, Point3], bot: "BotAI" = None) -> Union[int, float]:
          
          if bot and isinstance(p, Unit):
              index = bot.distances_tag_dict
              return (bot.unit_distances_dict[index[self.tag]][index[p.tag]]) ** 0.5
          return self.position.distance_to_point2(p.position)
docs: Using the 2d distance between self and p. To calculate the 3d distance,
          use unit.position3d.distance_to(p)