fix(simulation): address all round 3 PR review issues
- Register StorytellerPlugin in main() and dump_schedule_graph() so contamination system runs in production (critical, rounds 2+3) - Add doc comment to z_bands_connected clarifying band indices vs absolute z-levels (D-110) - Add TODO on hardcoded modifications: vec![] in save_to_file - Init ContaminationActive in minimal_world() test helper - Replace ChaCha20Rng with SimRng in fuzzy_map tests (D-010) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -147,6 +147,7 @@ fn main() {
|
||||
hot_reload: false,
|
||||
});
|
||||
app.add_plugins(settled_reach_server::content::ContentPlugin);
|
||||
app.add_plugins(settled_reach_server::storyteller::StorytellerPlugin);
|
||||
app.insert_resource(BridgeResource::new(bridge));
|
||||
app.insert_resource(HandshakeState::Complete);
|
||||
|
||||
@@ -323,6 +324,7 @@ fn dump_schedule_graph() {
|
||||
app.add_plugins(settled_reach_server::knowledge::KnowledgePlugin);
|
||||
app.add_plugins(settled_reach_server::npc::NpcPlugin);
|
||||
app.add_plugins(settled_reach_server::content::ContentPlugin);
|
||||
app.add_plugins(settled_reach_server::storyteller::StorytellerPlugin);
|
||||
app.insert_resource(settled_reach_server::simulation::rng::SimRng::new(0));
|
||||
|
||||
// Access Schedules resource directly — schedules are populated by plugins
|
||||
|
||||
@@ -345,7 +345,8 @@ pub struct FloorZone {
|
||||
pub struct VerticalCorridorSpec {
|
||||
/// Which blocks this vertical corridor passes through.
|
||||
pub block_coords: Vec<(u8, u8)>,
|
||||
/// Which z-bands this corridor connects.
|
||||
/// Which z-bands (0-indexed band indices, not absolute z-levels) this
|
||||
/// corridor connects. See D-110 for signed z-level coordinate system.
|
||||
pub z_bands_connected: Vec<u8>,
|
||||
pub access_tier: AccessTier,
|
||||
pub corridor_type: VerticalCorridorType,
|
||||
|
||||
@@ -145,7 +145,7 @@ pub fn save_to_file(path: &Path, world: &mut World) -> Result<(), SaveLoadError>
|
||||
ids.sort_by_key(|id| id.0);
|
||||
ids
|
||||
},
|
||||
modifications: vec![],
|
||||
modifications: vec![], // TODO: persist when modification system is implemented
|
||||
contamination_active: world
|
||||
.get_resource::<ContaminationActive>()
|
||||
.map_or(false, |c| c.0),
|
||||
@@ -400,6 +400,7 @@ mod tests {
|
||||
w.insert_resource(SimRng::new(42));
|
||||
w.insert_resource(RelationshipGraph::new());
|
||||
w.init_resource::<EntityRegistry>();
|
||||
w.init_resource::<ContaminationActive>();
|
||||
w
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
//! Spec reference: D-010 (deterministic simulation, SimRng seeding), D-030 (testability)
|
||||
|
||||
use rand::Rng;
|
||||
use rand::SeedableRng;
|
||||
use rand_chacha::ChaCha20Rng;
|
||||
use settled_reach_server::simulation::movement::{TilePosition, WalkabilityMap};
|
||||
use settled_reach_server::simulation::rng::SimRng;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
// ── Map generation constants ────────────────────────────────────────────────
|
||||
@@ -63,7 +62,7 @@ struct ProceduralMap {
|
||||
// ── Map generator ─────────────────────────────────────────────────────────────
|
||||
|
||||
fn generate_map(seed: u64) -> ProceduralMap {
|
||||
let mut rng = ChaCha20Rng::seed_from_u64(seed);
|
||||
let mut rng = SimRng::new(seed).rng;
|
||||
let mut wm = WalkabilityMap::new_blocked(MAP_W, MAP_H, 1);
|
||||
let mut rooms: Vec<Room> = Vec::new();
|
||||
let mut door_placements: Vec<DoorPlacement> = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user