pub struct WorldView {
pub width: usize,
pub height: usize,
pub cells: Vec<String>,
pub cell_fg: Vec<Option<RgbColor>>,
pub target_t1_cells: Vec<bool>,
pub target_t2_cells: Vec<bool>,
pub origin_x: f32,
pub origin_y: f32,
pub inside_building: Option<String>,
}Expand description
The TUI map uses one terminal cell per world meter on both axes so terrain, entities, resources, and mouse targeting share the same grid. Terminal fonts are taller than wide, so buildings look vertically stretched compared to the content-admin editor.
Fields§
§width: usize§height: usize§cells: Vec<String>§cell_fg: Vec<Option<RgbColor>>Per-cell foreground color from presentation catalog (None = entity-specific style).
target_t1_cells: Vec<bool>T1 target ring (red).
target_t2_cells: Vec<bool>T2 target ring (blue).
origin_x: f32§origin_y: f32§inside_building: Option<String>Implementations§
Source§impl WorldView
impl WorldView
pub fn build_with_target( state: &GameState, view_w: usize, view_h: usize, map_target: Option<(f32, f32)>, ) -> Self
Sourcepub fn build_with_options(
state: &GameState,
view_w: usize,
view_h: usize,
map_target: Option<(f32, f32)>,
options: WorldViewOptions,
) -> Self
pub fn build_with_options( state: &GameState, view_w: usize, view_h: usize, map_target: Option<(f32, f32)>, options: WorldViewOptions, ) -> Self
Like [build_with_target] with gfx/TUI presentation flags.
Auto Trait Implementations§
impl Freeze for WorldView
impl RefUnwindSafe for WorldView
impl Send for WorldView
impl Sync for WorldView
impl Unpin for WorldView
impl UnsafeUnpin for WorldView
impl UnwindSafe for WorldView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more