//! `VisionQuery` — handler-side access to the per-seat
//! perceivability model (S26).
//!
//! The engine's vision fixture computes, for each `(seat, entity)`
//! pair, a `PerceivabilityFlags` value combining `PRESENT` /
//! `LOCATED` / `OBSERVABLE` based on `SenseData`-attached observer
//! entities, the loaded map's opacity, and the session's
//! `VisionModel`. That logic lives in
//! `maat_engine::fixtures::vision` and depends on engine
//! internals (the loaded map, the spatial index).
//!
//! `VisionQuery` exposes the resolved per-seat flags plus the
//! convenience `can_see` predicate handlers actually want at the
//! call site.

use crate::trait_data::PerceivabilityFlags;
use crate::types::{EntityId, SeatId};

pub trait VisionQuery {
    /// `true` iff `target` is at least `LOCATED` (board position
    /// visible) to seats that own the `observer_seat`'s viewpoint.
    /// Useful as the cheap go/no-go check for "can the caster
    /// target this entity?"
    fn can_see(&self, observer_seat: SeatId, target: EntityId) -> bool;

    /// Full per-seat perceivability flags for `target`. Returns
    /// the trio `(PRESENT, LOCATED, OBSERVABLE)` packed into the
    /// existing bitflags type. Useful for handlers that need
    /// finer distinctions than `can_see` (e.g., "I know it's
    /// there, but not where" → `PRESENT && !LOCATED`).
    fn perceivability(&self, seat: SeatId, target: EntityId) -> PerceivabilityFlags;
}
