Add Building and Unit structs, extend CellWidget

Introduce empty Building and Unit types and expose them
through new modules. Extend CellWidget to store optional
Unit and Building, update its constructor, and adjust board
rendering to create cells with these new fields (currently always None).
This commit is contained in:
2026-04-13 21:27:44 +02:00
parent 1393f282e8
commit 44d29bd3ad
7 changed files with 26 additions and 4 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
use crate::app::states::ZoomLevel;
use crate::app::{buildings::Building, states::ZoomLevel, units::Unit};
use ratatui::{
buffer::Buffer,
layout::{Alignment, Rect},
@@ -28,6 +28,8 @@ pub struct CellWidget {
zoom_level: ZoomLevel,
tag: CellTag,
marked: bool,
unit: Option<Unit>,
building: Option<Building>,
}
impl CellWidget {
@@ -37,6 +39,8 @@ impl CellWidget {
zoom_level: ZoomLevel,
selected: bool,
tag: CellTag,
unit: Option<Unit>,
building: Option<Building>,
) -> Self {
Self {
row,
@@ -45,6 +49,8 @@ impl CellWidget {
zoom_level,
tag,
marked: false,
unit,
building,
}
}