generated from GarandPLG/rust-flake-template
Refactor GameMode and Players into skirmish_states
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.
This commit is contained in:
1 parent
f7c1795f29
commit
b639531841
17 files changed
+88
-59
No files matched your search
@@ -1,4 +1,4 @@
|
||||
use crate::app::states::{Players, skirmish_states::units::Unit};
|
||||
use crate::app::states::skirmish_states::{Players, units::Unit};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct MinerUnit {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::app::states::{
|
||||
use crate::app::states::skirmish_states::{
|
||||
Players,
|
||||
skirmish_states::units::{MinerUnit, Unit},
|
||||
units::{MinerUnit, Unit},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@@ -40,6 +40,6 @@ impl Unit for Option<Units> {
|
||||
}
|
||||
|
||||
fn get_owner(&self) -> Players {
|
||||
self.map_or(Players::Enemy, |u| u.get_owner())
|
||||
self.map_or(Players::Unclaimed, |u| u.get_owner())
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::app::states::Players;
|
||||
use crate::app::states::skirmish_states::Players;
|
||||
|
||||
pub trait Unit {
|
||||
fn get_owner(&self) -> Players;
|
||||
|
||||
Reference in new issue
Block a user