pub trait UnitsIterator: Iterator + Sized{
Show 19 methods
// Provided methods
fn find_tag(self, tag: u64) -> Option<Self::Item> { ... }
fn find_tags<T: Container<u64>>(self, tags: &T) -> FindTags<'_, Self, T> ⓘ { ... }
fn of_type(self, unit_type: UnitTypeId) -> OfType<Self> ⓘ { ... }
fn exclude_type(self, unit_type: UnitTypeId) -> ExcludeType<Self> ⓘ { ... }
fn of_types<T: Container<UnitTypeId>>(
self,
types: &T,
) -> OfTypes<'_, Self, T> ⓘ { ... }
fn exclude_types<T: Container<UnitTypeId>>(
self,
types: &T,
) -> ExcludeTypes<'_, Self, T> ⓘ { ... }
fn ground(self) -> Ground<Self> ⓘ { ... }
fn flying(self) -> Flying<Self> ⓘ { ... }
fn ready(self) -> Ready<Self> ⓘ { ... }
fn not_ready(self) -> NotReady<Self> ⓘ { ... }
fn idle(self) -> Idle<Self> ⓘ { ... }
fn almost_idle(self) -> AlmostIdle<Self> ⓘ { ... }
fn unused(self) -> Unused<Self> ⓘ { ... }
fn almost_unused(self) -> AlmostUnused<Self> ⓘ { ... }
fn visible(self) -> Visible<Self> ⓘ { ... }
fn in_range_of(self, unit: &Unit, gap: f32) -> InRangeOf<'_, Self> ⓘ { ... }
fn in_range(self, unit: &Unit, gap: f32) -> InRange<'_, Self> ⓘ { ... }
fn in_real_range_of(self, unit: &Unit, gap: f32) -> InRealRangeOf<'_, Self> ⓘ { ... }
fn in_real_range(self, unit: &Unit, gap: f32) -> InRealRange<'_, Self> ⓘ { ... }
}
Expand description
Helper trait for iterators over units.
Provided Methods§
Sourcefn find_tag(self, tag: u64) -> Option<Self::Item>
fn find_tag(self, tag: u64) -> Option<Self::Item>
Searches for unit with given tag and returns it if found.
Leaves only units with given tags.
Sourcefn of_type(self, unit_type: UnitTypeId) -> OfType<Self> ⓘ
fn of_type(self, unit_type: UnitTypeId) -> OfType<Self> ⓘ
Leaves only units of given type.
Sourcefn exclude_type(self, unit_type: UnitTypeId) -> ExcludeType<Self> ⓘ
fn exclude_type(self, unit_type: UnitTypeId) -> ExcludeType<Self> ⓘ
Excludes units of given type.
Sourcefn of_types<T: Container<UnitTypeId>>(self, types: &T) -> OfTypes<'_, Self, T> ⓘ
fn of_types<T: Container<UnitTypeId>>(self, types: &T) -> OfTypes<'_, Self, T> ⓘ
Leaves only units of given types.
Sourcefn exclude_types<T: Container<UnitTypeId>>(
self,
types: &T,
) -> ExcludeTypes<'_, Self, T> ⓘ
fn exclude_types<T: Container<UnitTypeId>>( self, types: &T, ) -> ExcludeTypes<'_, Self, T> ⓘ
Excludes units of given types.
Sourcefn almost_idle(self) -> AlmostIdle<Self> ⓘ
fn almost_idle(self) -> AlmostIdle<Self> ⓘ
Leaves only units with no orders or that almost finished their orders.
Sourcefn unused(self) -> Unused<Self> ⓘ
fn unused(self) -> Unused<Self> ⓘ
Leaves only units with no orders.
Unlike idle
this takes reactor on terran buildings into account.
Sourcefn almost_unused(self) -> AlmostUnused<Self> ⓘ
fn almost_unused(self) -> AlmostUnused<Self> ⓘ
Leaves only units with no orders or that almost finished their orders.
Unlike almost_idle
this takes reactor on terran buildings into account.
Sourcefn in_range_of(self, unit: &Unit, gap: f32) -> InRangeOf<'_, Self> ⓘ
fn in_range_of(self, unit: &Unit, gap: f32) -> InRangeOf<'_, Self> ⓘ
Leaves only units in attack range of given unit.
Sourcefn in_range(self, unit: &Unit, gap: f32) -> InRange<'_, Self> ⓘ
fn in_range(self, unit: &Unit, gap: f32) -> InRange<'_, Self> ⓘ
Leaves only units that are close enough to attack given unit.
Sourcefn in_real_range_of(self, unit: &Unit, gap: f32) -> InRealRangeOf<'_, Self> ⓘ
fn in_real_range_of(self, unit: &Unit, gap: f32) -> InRealRangeOf<'_, Self> ⓘ
Leaves only units in attack range of given unit.
Unlike in_range_of
this takes range upgrades into account.
Sourcefn in_real_range(self, unit: &Unit, gap: f32) -> InRealRange<'_, Self> ⓘ
fn in_real_range(self, unit: &Unit, gap: f32) -> InRealRange<'_, Self> ⓘ
Leaves only units that are close enough to attack given unit.
Unlike in_range
this takes range upgrades into account.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.