Skip to content

Commit

Permalink
add regiment temporary-related functions (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgi388 authored Feb 20, 2025
1 parent bf8d24f commit 027e156
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/army/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,21 @@ impl Regiment {
self.flags.insert(RegimentFlags::MUST_DEPLOY);
}

/// Marks the regiment as temporary.
pub fn mark_temporary(&mut self) {
self.flags.insert(RegimentFlags::TEMPORARY);
}

/// Returns `true` if the regiment must be deployed.
pub fn must_deploy(&self) -> bool {
self.flags.contains(RegimentFlags::MUST_DEPLOY)
}

/// Returns `true` if the regiment is temporary.
pub fn is_temporary(&self) -> bool {
self.flags.contains(RegimentFlags::TEMPORARY)
}

/// Returns `true` if the regiment is deployable.
pub fn is_deployable(&self) -> bool {
self.flags.contains(RegimentFlags::ACTIVE)
Expand Down

0 comments on commit 027e156

Please sign in to comment.