pub struct CountOptions<'a> {
pub completion: Completion,
pub alias: UnitAlias,
/* private fields */
}Expand description
Options used to configure which units are counted.
Constructed with counter and enemy_counter methods.
Fields§
§completion: CompletionState of counted units. Can be:
Complete- only complete unitsOrdered- only units in progressAll- both compete and ordered units
[Default: Complete]
alias: UnitAliasAlias of counted units. Can be:
None- don’t count aliasUnit- count unit-alias, used when unit has 2 formsTech- count tech-alias, used when unit has more than 2 forms (usually structures)
[Default: None]
Implementations§
Source§impl<'a> CountOptions<'a>
impl<'a> CountOptions<'a>
Sourcepub fn count(&self, unit_id: UnitTypeId) -> usize
pub fn count(&self, unit_id: UnitTypeId) -> usize
Counts units of given type and returns the result.
Trait Implementations§
Source§impl<'a> Clone for CountOptions<'a>
impl<'a> Clone for CountOptions<'a>
Source§fn clone(&self) -> CountOptions<'a>
fn clone(&self) -> CountOptions<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CountOptions<'_>
impl Debug for CountOptions<'_>
impl<'a> Copy for CountOptions<'a>
Auto Trait Implementations§
impl<'a> Freeze for CountOptions<'a>
impl<'a> !RefUnwindSafe for CountOptions<'a>
impl<'a> !Send for CountOptions<'a>
impl<'a> !Sync for CountOptions<'a>
impl<'a> Unpin for CountOptions<'a>
impl<'a> !UnwindSafe for CountOptions<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more