1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (C) 2025 Christian Mauduit <ufoot@ufoot.org>
//! Dynamic topology for meshes with conditional connectivity.
//!
//! This module provides tools for creating meshes with conditional or dynamic connectivity,
//! such as one-way passages, doors that can open/close, or connections that depend on
//! game state or external conditions.
//!
//! # Overview
//!
//! While standard meshes have fixed connectivity (e.g., a 2D grid always connects to
//! its 8 neighbors), topology allows you to conditionally enable or disable specific
//! connections at runtime. This is useful for:
//!
//! - **One-way passages**: Movement allowed only in one direction
//! - **Dynamic doors**: Connections that can be opened or closed
//! - **Conditional gates**: Movement allowed based on game state (keys, switches, etc.)
//! - **Asymmetric graphs**: Different paths available depending on direction
//!
//! # Main Types
//!
//! - [`Topology`] - Trait for defining which connections are allowed between nodes
//! - [`TopologyBool`] - Simple topology controlled by a boolean flag (all connections on/off)
//! - [`MeshWithTopology`] - Wrapper that combines a mesh with topology rules
//!
//! # Example
//!
//! ```
//! use shortestpath::{Mesh, Gradient, mesh_2d::Full2D, mesh_topo::{MeshWithTopology, TopologyBool}};
//!
//! // Create a base mesh
//! let base_mesh = Full2D::new(5, 5);
//!
//! // Create a topology that can enable/disable all connections
//! let mut topology = TopologyBool::new(true);
//!
//! // Wrap mesh with topology
//! let mesh = MeshWithTopology::new(&base_mesh, &topology);
//!
//! // Use for pathfinding - all connections enabled
//! let mut gradient = Gradient::from_mesh(&mesh);
//! gradient.set_distance(12, 0.0);
//! gradient.spread(&mesh);
//!
//! // Later, disable all connections by changing topology
//! topology.set(false);
//! // Now the mesh would have no connections when used again
//! ```
pub use *;
pub use *;
pub use *;