fix(simulation): address PR #42 review — 8 items from Hoshe and Tyre
1. Sound producers: document empty v0.1 pipeline explicitly (critical) 2. Routine tests: add ActiveSim to 3 tests that passed trivially 3. Rename _observer_pos → observer_pos (used at line 191) 4. Add FactionOnly positive test case (matching faction_id) 5. Fix stale doc comment "Current: 9" → 10 in ObserverSnapshot 6. Remove orphaned SimulationTier/LastInteraction/ScopeTag types 7. Add tracing::warn on FactionOnly non-numeric parse failure 8. Document Medium-range occlusion gap as TODO in audible_at 9. Insert SoundEventQueue in observer test setup_world Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -83,7 +83,9 @@ impl SoundEvent {
|
||||
}
|
||||
|
||||
/// Whether this sound is audible at `listener_pos`.
|
||||
/// Simple tile-distance check; occlusion is a future concern (D-018 note).
|
||||
/// Simple tile-distance check — no wall/obstruction occlusion.
|
||||
/// TODO: Medium-range sounds should be attenuated or blocked by walls
|
||||
/// per D-018. Requires LOS integration (backlog — not in v0.1 scope).
|
||||
pub fn audible_at(&self, listener_pos: &TilePosition) -> bool {
|
||||
let ceil = Self::max_range_tiles(self.range);
|
||||
let dx = (self.x.floor() as i32).abs_diff(listener_pos.x);
|
||||
@@ -157,6 +159,13 @@ impl SoundEventQueue {
|
||||
/// Runs each tick after movement/monologue/dialogue systems have fired.
|
||||
/// Removes the emitter component after draining. Ordering: after movement,
|
||||
/// before `compute_observer_snapshot`.
|
||||
///
|
||||
/// NOTE: v0.1 has no sound producers — no system currently inserts
|
||||
/// SoundEventEmitter components. The pipeline (emitter → queue → snapshot →
|
||||
/// client bridge) is fully wired but produces zero events at runtime.
|
||||
/// Sound producers (Footstep on movement, Voice on dialogue) are backlog
|
||||
/// scope and will be added when the client audio bus routing (#125) is
|
||||
/// integrated. See D-018 for the sound model specification.
|
||||
pub fn collect_sound_events(
|
||||
mut commands: Commands,
|
||||
mut queue: ResMut<SoundEventQueue>,
|
||||
|
||||
Reference in New Issue
Block a user