Board layers

This commit is contained in:
2026-06-15 23:35:18 -05:00
parent d1d0824d37
commit 01cd73ca3b
29 changed files with 2166 additions and 2051 deletions
+8 -3
View File
@@ -1,7 +1,7 @@
use color::Rgba8;
use std::collections::HashSet;
use crate::glyph::Glyph;
use crate::utils::ObjectId;
use color::Rgba8;
use std::collections::HashSet;
/// A scripted object placed on the board, loaded from a map file.
///
@@ -32,6 +32,10 @@ pub struct ObjectDef {
pub x: usize,
/// Row of this object on the board (0-indexed).
pub y: usize,
/// Index of the layer this object belongs to (0 = bottom). Determines its
/// draw order: objects on higher layers render above lower-layer terrain and
/// objects. Set at load from the layer the object's palette char appeared in.
pub z: usize,
/// Visual representation of this object. Owned by the object (not derived
/// from the grid cell), so scripts can change tile, fg, and bg at runtime.
pub glyph: Glyph,
@@ -78,6 +82,7 @@ impl ObjectDef {
id: 0,
x,
y,
z: 0,
glyph: Self::default_glyph(),
solid: true,
opaque: true,
@@ -87,4 +92,4 @@ impl ObjectDef {
name: None,
}
}
}
}