generated from GarandPLG/rust-flake-template
Refactor Units enum location and chain CellWidget setters
Move Units enum from the units module into the skirmish state module, add a dedicated Players enum, and remove the now‑unused unit module. Update all imports accordingly. Adjust CellWidget's set_zoom_level and set_structure to return &mut Self, enabling method chaining.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::app::{buildings::BaseBuilding, states::skirmish_states::BoardState};
|
||||
use crate::app::{buildings::BaseBuilding, states::skirmish_states::BoardState, units::MinerUnit};
|
||||
use clap::ValueEnum;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
@@ -21,6 +21,12 @@ pub enum ZoomLevel {
|
||||
ZoomedOut,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Players {
|
||||
Player,
|
||||
Enemy,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum CellStructure {
|
||||
Base(BaseBuilding),
|
||||
@@ -29,7 +35,6 @@ pub enum CellStructure {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Players {
|
||||
Player,
|
||||
Enemy,
|
||||
pub enum Units {
|
||||
Miner(MinerUnit),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user