/// <summary> /// Finds the shortest path from this Unit to the given goal. /// Does not include this Unit's own position in the list. /// Returns "null" if a path wasn't found. /// IMPORTANT: The returned list is reused for other calls to this method, /// so treat it as a temp variable! /// </summary> public List <Vector2i> FindPath(Pathfinding.Goal <Vector2i> goal, bool avoidEnemies) { return(TheMap.FindPath(Pos, goal, MakeHeuristic(avoidEnemies))); }