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 parent
6dc5f8605c
commit
e6d87dd064
6 files changed
+18
-21
No files matched your search
@@ -1,7 +1,4 @@
|
||||
use crate::app::{
|
||||
states::{CellStructure, Players, ZoomLevel},
|
||||
units::Units,
|
||||
};
|
||||
use crate::app::states::{CellStructure, Players, Units, ZoomLevel};
|
||||
use ratatui::{
|
||||
buffer::Buffer,
|
||||
layout::{Alignment, Rect},
|
||||
@@ -46,12 +43,14 @@ impl CellWidget {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_zoom_level(&mut self, zoom_level: ZoomLevel) {
|
||||
pub fn set_zoom_level(&mut self, zoom_level: ZoomLevel) -> &mut Self {
|
||||
self.zoom_level = zoom_level;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_structure(&mut self, sctructure: CellStructure) {
|
||||
pub fn set_structure(&mut self, sctructure: CellStructure) -> &mut Self {
|
||||
self.structure = sctructure;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn get_marked(&self) -> bool {
|
||||
|
||||
Reference in new issue
Block a user