generated from GarandPLG/rust-flake-template
b639531841
Move the GameMode and Players enums from the top‑level states module into the skirmish_states submodule, add an Unclaimed variant to Players, and update all imports, trait implementations, and related logic accordingly. Adjust the durability percentage calculation to use u32 for safety.
27 lines
452 B
Rust
27 lines
452 B
Rust
use crate::app::states::skirmish_states::{Players, units::Unit};
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub struct MinerUnit {
|
|
owner: Players,
|
|
}
|
|
|
|
impl MinerUnit {
|
|
pub fn new(owner: Players) -> Self {
|
|
Self { owner }
|
|
}
|
|
}
|
|
|
|
impl Unit for MinerUnit {
|
|
fn get_owner(&self) -> Players {
|
|
self.owner
|
|
}
|
|
|
|
fn get_tag(&self) -> char {
|
|
'M'
|
|
}
|
|
|
|
fn get_name(&self) -> &'static str {
|
|
"Miner"
|
|
}
|
|
}
|