//! Road-frontage-based parcel subdivision for a city simulation game.
//!
//! This crate is a pure-logic geometric layer: it consumes a planar
//! road graph and produces a set of polygonal parcels with each parcel
//! facing exactly one road. It does not render, simulate buildings, or
//! drive a game loop.
//!
//! See `journal.tex` at the repository root for the full design
//! specification. Section numbers cited here refer to that document.
//!
//! # Quick start
//!
//! ```
//! use road_parceling::{RoadGraph, SubdivisionParams, subdivide_all};
//! use glam::DVec2;
//!
//! let mut g = RoadGraph::new();
//! let a = g.add_node(DVec2::new(0.0,   0.0));
//! let b = g.add_node(DVec2::new(200.0, 0.0));
//! let c = g.add_node(DVec2::new(200.0, 100.0));
//! let d = g.add_node(DVec2::new(0.0,   100.0));
//! g.add_road(a, b).unwrap();
//! g.add_road(b, c).unwrap();
//! g.add_road(c, d).unwrap();
//! g.add_road(d, a).unwrap();
//!
//! let params = SubdivisionParams::default();
//! let parcels = subdivide_all(&g, &params).unwrap();
//! assert!(!parcels.is_empty());
//! ```

#![deny(missing_docs)]
#![forbid(unsafe_code)]

pub mod config;
pub mod error;
pub mod geometry;
pub mod network;
pub mod parcel;

#[cfg(feature = "viz")]
pub mod viz;

pub use config::SubdivisionParams;
pub use error::{ParcelError, SubdivisionError};
pub use network::{NodeId, RoadGraph, RoadId};
pub use parcel::{
    apply_road_edit, subdivide_all, subdivide_all_with_stats, BuildingFitCheck, BuildingHandle,
    EdgeKind, EditOutcome, Parcel, ParcelId, ParcelSet, RoadEdit, SubdivisionStats, VertexId,
};
