generated from GarandPLG/rust-flake-template
Move ZoomLevel into skirmish_states
Introduce Structure and Unit traits with enum wrappers. Replace old zoom helper with ZoomLevel methods. Update imports, BoardState, CellWidget, and CLI to use new locations.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
use crate::app::states::skirmish_states::units::{MinerUnit, OptionalUnit, Unit};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Units {
|
||||
Miner(MinerUnit),
|
||||
}
|
||||
|
||||
impl Units {
|
||||
pub fn get_tag(&self) -> char {
|
||||
match self {
|
||||
Units::Miner(m) => m.get_tag(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl OptionalUnit for Option<Units> {
|
||||
fn try_get_tag(&self) -> char {
|
||||
self.map_or(' ', |u| u.get_tag())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user