generated from GarandPLG/rust-flake-template
Add Stone and Tunnel, refactor CellStructure
Introduce new building types Stone and Tunnel with their own tag, color, and properties. CellStructure now holds these structs (Tunnel, Stone) instead of simple variants. BaseBuilding is simplified to return a char tag and a color based on owner. BoardState creation and CellWidget rendering are updated to use the new building structs and their methods.
This commit is contained in:
@@ -2,7 +2,11 @@ use crate::app::{
|
||||
helpers::{CellSizes, cell_size_helper, cells_area_helper},
|
||||
states::{
|
||||
CellStructure, FocusedCell, Offset, Players, Units, ZoomLevel,
|
||||
skirmish_states::{MoveFocusedCell, buildings::BaseBuilding, units::MinerUnit},
|
||||
skirmish_states::{
|
||||
MoveFocusedCell,
|
||||
buildings::{BaseBuilding, Stone},
|
||||
units::MinerUnit,
|
||||
},
|
||||
},
|
||||
widgets::CellWidget,
|
||||
};
|
||||
@@ -68,7 +72,7 @@ impl BoardState {
|
||||
} else if enemy_base {
|
||||
CellStructure::Base(BaseBuilding::new(Players::Enemy))
|
||||
} else {
|
||||
CellStructure::Stone
|
||||
CellStructure::Stone(Stone::new())
|
||||
};
|
||||
|
||||
let unit: Option<Units> = if player_base {
|
||||
|
||||
Reference in New Issue
Block a user