feat(simulation): ban HashMap via clippy disallowed_types, fix violations (#343)
Adds server/.clippy.toml with disallowed-types for std::collections::HashMap and std::collections::HashSet. HashMap iteration order is non-deterministic and breaks deterministic simulation replay (D-030). Changes: - server/.clippy.toml: disallow HashMap and HashSet crate-wide - simulation/movement.rs: WalkabilityMap.chunks and occupied map → BTreeMap; add PartialOrd+Ord to ChunkCoord, TilePosition, TilePresence - simulation/monologue.rs: MonologueState.shown_ids → BTreeSet (simulation state) - perception/shadowcast.rs: #![allow] — per-frame FOV scratch, iteration irrelevant - perception/interpretation.rs: #![allow] — per-frame lookup table, key-only access - perception/query.rs: #![allow] — sector_lookup is a per-frame read-only cache Also applies cargo fmt to pre-existing format drift in contraband.rs, dialogue.rs, test_world/mod.rs, and several integration tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,17 @@ pub struct PlayerCharacter;
|
||||
/// Examples: a Standing character can walk past a Seated NPC at a console,
|
||||
/// a Fixture (terminal) shares a tile with someone Seated at it.
|
||||
#[derive(
|
||||
Component, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Default, Serialize,
|
||||
Component,
|
||||
Debug,
|
||||
Clone,
|
||||
Copy,
|
||||
PartialEq,
|
||||
Eq,
|
||||
Hash,
|
||||
PartialOrd,
|
||||
Ord,
|
||||
Default,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
)]
|
||||
pub enum TilePresence {
|
||||
@@ -42,7 +52,9 @@ pub enum TilePresence {
|
||||
/// Tile position component for grid-based movement.
|
||||
/// Discrete integer coordinates used in simulation; converted to f32
|
||||
/// at the bridge boundary for VisibleEntity wire format.
|
||||
#[derive(Component, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
|
||||
#[derive(
|
||||
Component, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize,
|
||||
)]
|
||||
pub struct TilePosition {
|
||||
pub x: i32,
|
||||
pub y: i32,
|
||||
|
||||
Reference in New Issue
Block a user