refactoring
This commit is contained in:
@@ -1,24 +1,25 @@
|
||||
//! The floor layer: a per-cell visual background drawn wherever a board cell
|
||||
//! would otherwise render as [`Archetype::Empty`](crate::game::Archetype::Empty).
|
||||
//! would otherwise render as [`Archetype::Empty`](crate::archetype::Archetype::Empty).
|
||||
//!
|
||||
//! The floor is purely cosmetic — it carries no behavior. It exists to give
|
||||
//! boards some non-distracting visual flavor (textured ground) with little
|
||||
//! authoring effort, including randomly-generated "grass" / "dirt" / "stone".
|
||||
//!
|
||||
//! A board's floor is computed once at load time ([`build_floor`]) and cached as
|
||||
//! a `Vec<Glyph>` on the [`Board`](crate::game::Board); generators are run during
|
||||
//! a `Vec<Glyph>` on the [`Board`](crate::board::Board); generators are run during
|
||||
//! that single pass and their results stored, so there is no per-frame cost and
|
||||
//! no tile flicker. The raw [`FloorSpec`] is also kept on the board so a save
|
||||
//! round-trips the declaration (generators re-randomize on reload; literal glyph
|
||||
//! grids are preserved exactly).
|
||||
|
||||
use crate::game::{Archetype, Glyph};
|
||||
use crate::archetype::Archetype;
|
||||
use crate::log::LogLine;
|
||||
use crate::map_file::{TileIndex, parse_color};
|
||||
use crate::map_file::{parse_color, TileIndex};
|
||||
use color::Rgba8;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use tinyrand::{Probability, Rand, Seeded, StdRand};
|
||||
use crate::glyph::Glyph;
|
||||
|
||||
/// Fixed seed for the floor PRNG, so a board's generated floor is deterministic
|
||||
/// for a given spec (stable across reloads within a run, and testable).
|
||||
|
||||
Reference in New Issue
Block a user