Filtered

open class Filtered<T, P : Position<P>, Vector<P>>(steerStrategy: SteeringStrategy<T, P>, filter: List<SteeringAction<T, P>>.() -> List<SteeringAction<T, P>>) : SteeringStrategy<T, P> (source)

Decorator for a SteeringStrategy that filters the provided steering actions before delegating the combination logic to the wrapped strategy.

Parameters

steerStrategy

the underlying strategy to which the filtered actions are delegated.

filter

the filter function applied to the actions list before delegation.

Type Parameters

T

the concentration type.

P

the Position type used by the strategy.

Inheritors

Constructors

Link copied to clipboard
constructor(steerStrategy: SteeringStrategy<T, P>, filter: List<SteeringAction<T, P>>.() -> List<SteeringAction<T, P>>)

Functions

Link copied to clipboard
open override fun computeNextPosition(actions: List<SteeringAction<T, P>>): P

Delegates to steerStrategy after applying filter to actions.

Link copied to clipboard
open override fun computeTarget(actions: List<SteeringAction<T, P>>): P

Computes the absolute target position derived from the provided steering actions.