Skip to main content

HexNeighborValidator

Trait HexNeighborValidator 

Source
pub trait HexNeighborValidator {
    type PointData;

    // Required method
    fn validate(
        &self,
        source_index: usize,
        source_data: &Self::PointData,
        candidate: &NeighborCandidate,
        candidate_data: &Self::PointData,
    ) -> Option<(HexDirection, f32)>;
}
Expand description

Extension point for hex-pattern-specific neighbor validation.

Implementors decide whether a spatially close point is a valid hex grid neighbor, and if so, assign it a direction and quality score.

Required Associated Types§

Source

type PointData

Per-point data beyond position (e.g., orientation angle). Use () if no extra data is needed.

Required Methods§

Source

fn validate( &self, source_index: usize, source_data: &Self::PointData, candidate: &NeighborCandidate, candidate_data: &Self::PointData, ) -> Option<(HexDirection, f32)>

Validate whether candidate is a valid hex grid neighbor of the point at source_index. Returns (direction, score) where lower score is better, or None to reject.

Implementors§