Skip to main content

euv_core/game/algorithms/procgen/
enum.rs

1/// Distance metric used by Worley / cellular noise evaluation.
2#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
3pub enum WorleyMetric {
4    /// Standard Euclidean distance `sqrt(dx^2 + dy^2 [+ dz^2])`.
5    #[default]
6    Euclidean,
7    /// Taxicab / Manhattan L1 distance `|dx| + |dy| [+ |dz|]`.
8    Manhattan,
9    /// Chessboard / Chebyshev L-infinity distance `max(|dx|, |dy| [, |dz|])`.
10    Chebyshev,
11}
12
13/// Output feature selector for Worley / cellular noise.
14#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
15pub enum WorleyOutput {
16    /// Distance to the nearest feature point (`F1`).
17    #[default]
18    F1,
19    /// Distance to the second-nearest feature point (`F2`).
20    F2,
21    /// Voronoi cell border distance (`F2 - F1`).
22    F2MinusF1,
23}
24
25/// Cardinal adjacency direction in 2D Wave Function Collapse grids.
26#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
27pub enum WfcDirection {
28    /// Neighbor at `(x, y - 1)`.
29    North,
30    /// Neighbor at `(x + 1, y)`.
31    East,
32    /// Neighbor at `(x, y + 1)`.
33    South,
34    /// Neighbor at `(x - 1, y)`.
35    West,
36}
37
38/// Semantic tile classification produced by `BspDungeonGenerator`.
39#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
40pub enum BspTileKind {
41    /// Solid impassable wall tile.
42    #[default]
43    Wall,
44    /// Walkable interior room floor tile.
45    Floor,
46    /// Walkable connecting corridor tile.
47    Corridor,
48    /// Walkable doorway threshold where a corridor meets a room perimeter.
49    Door,
50}