condor-pathfinding-grid 0.4.0

Grid pathfinding, preprocessing, replanning, and multi-agent algorithms for Condor.
Documentation
//! Integer coordinates for discrete grid cells.
//!
//! [`Point`] is a zero-based `x`/`y` address whose bounds are defined by a concrete
//! [`crate::Grid`]; loaders choose the visual origin, not solvers. Prefer
//! [`condor_core::Point2`] for any-angle or continuous coordinates.

/// A single grid cell address (`x` column, `y` row), zero-based.
///
/// Bounds are relative to a concrete [`crate::Grid`]; construction does not validate.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Point {
    /// Column index (increasing to the right in standard maps).
    pub x: usize,
    /// Row index (increasing downward or upward depending only on map loaders).
    pub y: usize,
}

impl Point {
    /// Constructs a cell address without bounds checking against a grid.
    #[must_use]
    pub const fn new(x: usize, y: usize) -> Self {
        Self { x, y }
    }
}

impl From<(usize, usize)> for Point {
    fn from((x, y): (usize, usize)) -> Self {
        Self::new(x, y)
    }
}