Function select_target

Source
pub fn select_target(
    candidates: impl IntoIterator<Item = Candidate>,
    observer: Observer,
    sight: Sight,
    budget: &mut WorkBudget,
    query: &mut impl VisibilityQuery,
    priority: impl FnMut(Candidate) -> f32,
) -> Result<TargetSelection, AiError>
Expand description

Budgeted deterministic priority selection. Non-finite scores are ignored; equal scores prefer the lower ID. Stops as soon as work is deferred, so an unbounded iterator cannot exhaust the frame. All returned targets passed sight.