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:
@@ -3,15 +3,14 @@ use crate::app::states::Players;
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct MinerUnit {
|
||||
owner: Players,
|
||||
tag: &'static str,
|
||||
}
|
||||
|
||||
impl MinerUnit {
|
||||
pub fn new(owner: Players) -> Self {
|
||||
Self { owner, tag: "M" }
|
||||
Self { owner }
|
||||
}
|
||||
|
||||
pub fn get_tag(self) -> &'static str {
|
||||
self.tag
|
||||
pub fn get_tag(self) -> char {
|
||||
'M'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user