fix(simulation): add TileKind to VisibleTile wire protocol (#412)
Server was sending visible_tiles without tile type data, so the client could not distinguish floor from wall in live mode. Add TileKind enum (Floor/Wall/Door/Object) to VisibleTile, populated from WalkabilityMap in the NaturalVision perception query. Update test fixtures to include the new field. Uses #[serde(default)] for backward compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,7 @@ pub enum FacingDirection {
|
||||
Northwest,
|
||||
}
|
||||
|
||||
/// A tile visible to the observer with its visibility quality
|
||||
/// A tile visible to the observer with its visibility quality and type
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct VisibleTile {
|
||||
pub x: i32,
|
||||
@@ -81,6 +81,20 @@ pub struct VisibleTile {
|
||||
pub z: i32,
|
||||
/// Which vision cone sector this tile falls in (D-015)
|
||||
pub visibility: VisibilitySector,
|
||||
/// Tile type for client rendering (floor, wall, door, object)
|
||||
#[serde(default)]
|
||||
pub tile_kind: TileKind,
|
||||
}
|
||||
|
||||
/// Tile type for rendering. Derived from WalkabilityMap on the server side.
|
||||
/// v0.1: Floor (walkable) and Wall (blocked). Door and Object for future use.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
|
||||
pub enum TileKind {
|
||||
#[default]
|
||||
Floor,
|
||||
Wall,
|
||||
Door,
|
||||
Object,
|
||||
}
|
||||
|
||||
/// Vision cone sectors per D-015.
|
||||
|
||||
Reference in New Issue
Block a user