getPathToPosition method

List<Vector2> getPathToPosition(
  1. Vector2 position, {
  2. List<GameComponent>? ignoreCollisions,
})

Implementation

List<Vector2> getPathToPosition(
  Vector2 position, {
  List<GameComponent>? ignoreCollisions,
}) {
  _ignoreCollisions.clear();
  _ignoreCollisions.addAll(shapeHitboxes);

  ignoreCollisions?.forEach(
    (comp) => _ignoreCollisions.addAll(comp.shapeHitboxes),
  );
  return _calculatePath(position);
}