Extract visibility geometry into a separate system behind a PerceptionQuery trait, enabling D-017 perception mode swapping. Two-stage pipeline: compute_visibility_geometry writes to VisibilityGeometry resource, compute_observer_snapshot reads it. Remove KnowledgeGraph from compute_nearby_interactions (simulation phase boundary violation). Verb availability stays in simulation; POI-based priority adjustment moves to observer via apply_poi_verb_priority helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
43 lines
1.4 KiB
Rust
43 lines
1.4 KiB
Rust
// Simulation module - Core simulation plugin and systems
|
|
// Implements deterministic tick-based simulation (D-010 principle 4)
|
|
|
|
use bevy_app::prelude::*;
|
|
use bevy_ecs::schedule::IntoScheduleConfigs;
|
|
|
|
pub mod input;
|
|
pub mod interaction;
|
|
pub mod movement;
|
|
pub mod path_follow;
|
|
pub mod pathfinding;
|
|
pub mod rng;
|
|
pub mod tier;
|
|
pub mod time;
|
|
|
|
/// Core simulation plugin
|
|
/// Manages simulation time, RNG, input processing, and tier transitions
|
|
pub struct SimulationPlugin;
|
|
|
|
impl Plugin for SimulationPlugin {
|
|
fn build(&self, app: &mut App) {
|
|
// Initialize core simulation resources
|
|
app.init_resource::<time::SimulationTime>()
|
|
.insert_resource(rng::SimRng::new(0))
|
|
.init_resource::<input::InputQueue>()
|
|
.init_resource::<crate::knowledge::EntityRegistry>()
|
|
.add_systems(
|
|
Update,
|
|
(
|
|
input::process_player_input,
|
|
pathfinding::compute_paths.after(input::process_player_input),
|
|
path_follow::follow_paths.after(pathfinding::compute_paths),
|
|
movement::validate_movement.after(path_follow::follow_paths),
|
|
path_follow::cleanup_path_blocked.after(movement::validate_movement),
|
|
time::advance_tick
|
|
.after(path_follow::cleanup_path_blocked),
|
|
),
|
|
);
|
|
|
|
tracing::debug!("SimulationPlugin initialized");
|
|
}
|
|
}
|