pickNearestOrFirst
fun <T> List<SteeringAction<T, Euclidean2DPosition>>.pickNearestOrFirst(environment: Environment<T, Euclidean2DPosition>, node: Node<T>): SteeringAction<T, Euclidean2DPosition>?
Content copied to clipboard
Picks the SteeringActionWithTarget whose target is nearest to the node's current position, or the first action of the list if none of them has a defined target. If the list is empty, null is returned.