- Stage 2 collision: convoy skip when entities move same direction (dot>0.7), E/S yield rule for crossings, W/N right-of-way, head-on unchanged - TileChangedEvent (Message) + PathfindingDirtyChunks (Resource) in new tile_changed module - collect_pathfinding_dirty_chunks / invalidate_paths_on_tile_change / clear_pathfinding_dirty_chunks in PathfindingPlugin FixedUpdate chain - TileMap::remove_floor clears HashMap + ChunkData bitsets + tile_ids - RabbitDigTimer component: rabbits dig floor below every 5s, fires TileChangedEvent and TileOcclusionEvent for path invalidation + rendering
18 lines
437 B
Rust
18 lines
437 B
Rust
//! Tile change events and pathfinding dirty chunk tracking.
|
|
//!
|
|
//! This module provides types for tracking tile modifications and
|
|
//! invalidating pathfinding data when terrain changes.
|
|
|
|
use bevy::prelude::*;
|
|
use bevy_platform::collections::HashSet;
|
|
|
|
#[derive(Message, Clone, Copy)]
|
|
pub struct TileChangedEvent {
|
|
pub pos: IVec3,
|
|
}
|
|
|
|
#[derive(Resource, Default)]
|
|
pub struct PathfindingDirtyChunks {
|
|
pub chunks: HashSet<IVec2>,
|
|
}
|