fix(simulation): address PR #10 review — plugin wiring, stale reset, warnings
- Register KnowledgePlugin in main.rs and game_loop test (Tyre critical) - Add KnowledgeGraph component to player spawn (Tyre critical) - Reset Stale -> Active on fresh direct observation (Hoshe warning) - Make registry/queue non-optional in emit_observation_events (Tyre/Hoshe) - Add tracing::warn for missing EntityRegistry entries (Hoshe warning) - Replace HashSet with Vec for small entity ID lookups (Hoshe suggestion) - Add const static assertion for KnowledgeConfidence ordering (Hoshe) - Add is_empty() and known_facts_iter() to KnowledgeGraph (Tyre) - Add decay_skips_non_minute_ticks and observe_resets_stale tests (Hoshe) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+8
-2
@@ -6,6 +6,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
use settled_reach_server::bridge::tcp::TcpBridge;
|
||||
use settled_reach_server::bridge::{BridgePlugin, BridgeResource, ServerRunning};
|
||||
use settled_reach_server::knowledge::{KnowledgeGraph, KnowledgePlugin};
|
||||
use settled_reach_server::perception::vision_cone::Facing;
|
||||
use settled_reach_server::simulation::movement::{PlayerCharacter, TilePosition, WalkabilityMap};
|
||||
use settled_reach_server::simulation::SimulationPlugin;
|
||||
@@ -38,10 +39,15 @@ fn main() {
|
||||
let mut app = App::new();
|
||||
app.add_plugins(SimulationPlugin);
|
||||
app.add_plugins(BridgePlugin);
|
||||
app.add_plugins(KnowledgePlugin);
|
||||
app.insert_resource(BridgeResource::new(bridge));
|
||||
app.insert_resource(WalkabilityMap::new(32, 32, 1));
|
||||
app.world_mut()
|
||||
.spawn((PlayerCharacter, TilePosition::new(16, 16, 0), Facing::default()));
|
||||
app.world_mut().spawn((
|
||||
PlayerCharacter,
|
||||
TilePosition::new(16, 16, 0),
|
||||
Facing::default(),
|
||||
KnowledgeGraph::new(),
|
||||
));
|
||||
|
||||
tracing::info!("Simulation initialized, entering game loop");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user