Trait rust_sc2::units::iter::UnitsIterator [−][src]
pub trait UnitsIterator: Iterator + Sized where
Self::Item: Borrow<Unit>, {}Show 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>>(Notable traits for ExcludeType<I>
impl<I> Iterator for ExcludeType<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
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>ⓘNotable traits for ExcludeTypes<'a, I, T>
impl<'a, I, T> Iterator for ExcludeTypes<'a, I, T> where
I: Iterator,
I::Item: Borrow<Unit>,
T: Container<UnitTypeId>, type Item = I::Item;{ ... } fn unused(self) -> Unused<Self>ⓘ { ... } fn almost_unused(self) -> AlmostUnused<Self>ⓘNotable traits for AlmostIdle<I>
impl<I> Iterator for AlmostIdle<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;{ ... } 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>ⓘNotable traits for AlmostUnused<I>
impl<I> Iterator for AlmostUnused<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;{ ... } fn in_real_range(self, unit: &Unit, gap: f32) -> InRealRange<'_, Self>ⓘNotable traits for InRealRangeOf<'a, I>
impl<'a, I> Iterator for InRealRangeOf<'a, I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;{ ... }Notable traits for InRealRange<'a, I>
impl<'a, I> Iterator for InRealRange<'a, I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
Expand description
Helper trait for iterators over units.
Provided methods
fn find_tag(self, tag: u64) -> Option<Self::Item>
[src]
fn find_tag(self, tag: u64) -> Option<Self::Item>
[src]Searches for unit with given tag and returns it if found.
fn find_tags<T: Container<u64>>(self, tags: &T) -> FindTags<'_, Self, T>ⓘ
[src]
fn find_tags<T: Container<u64>>(self, tags: &T) -> FindTags<'_, Self, T>ⓘ
[src]Leaves only units with given tags.
fn of_type(self, unit_type: UnitTypeId) -> OfType<Self>ⓘ
[src]
fn of_type(self, unit_type: UnitTypeId) -> OfType<Self>ⓘ
[src]Leaves only units of given type.
fn exclude_type(self, unit_type: UnitTypeId) -> ExcludeType<Self>ⓘNotable traits for ExcludeType<I>
impl<I> Iterator for ExcludeType<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]
fn exclude_type(self, unit_type: UnitTypeId) -> ExcludeType<Self>ⓘNotable traits for ExcludeType<I>
impl<I> Iterator for ExcludeType<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]Excludes units of given type.
fn of_types<T: Container<UnitTypeId>>(self, types: &T) -> OfTypes<'_, Self, T>ⓘ
[src]
fn of_types<T: Container<UnitTypeId>>(self, types: &T) -> OfTypes<'_, Self, T>ⓘ
[src]Leaves only units of given types.
fn exclude_types<T: Container<UnitTypeId>>(
self,
types: &T
) -> ExcludeTypes<'_, Self, T>ⓘNotable traits for ExcludeTypes<'a, I, T>
impl<'a, I, T> Iterator for ExcludeTypes<'a, I, T> where
I: Iterator,
I::Item: Borrow<Unit>,
T: Container<UnitTypeId>, type Item = I::Item;
[src]
fn exclude_types<T: Container<UnitTypeId>>(
self,
types: &T
) -> ExcludeTypes<'_, Self, T>ⓘNotable traits for ExcludeTypes<'a, I, T>
impl<'a, I, T> Iterator for ExcludeTypes<'a, I, T> where
I: Iterator,
I::Item: Borrow<Unit>,
T: Container<UnitTypeId>, type Item = I::Item;
[src]Excludes units of given types.
fn ground(self) -> Ground<Self>ⓘ
[src]
fn ground(self) -> Ground<Self>ⓘ
[src]Leaves only non-flying units.
fn flying(self) -> Flying<Self>ⓘ
[src]
fn flying(self) -> Flying<Self>ⓘ
[src]Leaves only flying units.
fn ready(self) -> Ready<Self>ⓘ
[src]
fn ready(self) -> Ready<Self>ⓘ
[src]Leaves only ready structures.
fn not_ready(self) -> NotReady<Self>ⓘ
[src]
fn not_ready(self) -> NotReady<Self>ⓘ
[src]Leaves only structures in-progress.
fn idle(self) -> Idle<Self>ⓘ
[src]
fn idle(self) -> Idle<Self>ⓘ
[src]Leaves only units with no orders.
fn almost_idle(self) -> AlmostIdle<Self>ⓘNotable traits for AlmostIdle<I>
impl<I> Iterator for AlmostIdle<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]
fn almost_idle(self) -> AlmostIdle<Self>ⓘNotable traits for AlmostIdle<I>
impl<I> Iterator for AlmostIdle<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]Leaves only units with no orders or that almost finished their orders.
fn unused(self) -> Unused<Self>ⓘ
[src]
fn unused(self) -> Unused<Self>ⓘ
[src]Leaves only units with no orders.
Unlike idle
this takes reactor on terran buildings into account.
fn almost_unused(self) -> AlmostUnused<Self>ⓘNotable traits for AlmostUnused<I>
impl<I> Iterator for AlmostUnused<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]
fn almost_unused(self) -> AlmostUnused<Self>ⓘNotable traits for AlmostUnused<I>
impl<I> Iterator for AlmostUnused<I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]Leaves only units with no orders or that almost finished their orders.
Unlike almost_idle
this takes reactor on terran buildings into account.
fn visible(self) -> Visible<Self>ⓘ
[src]
fn visible(self) -> Visible<Self>ⓘ
[src]Leaves only units visible on current step.
fn in_range_of(self, unit: &Unit, gap: f32) -> InRangeOf<'_, Self>ⓘ
[src]
fn in_range_of(self, unit: &Unit, gap: f32) -> InRangeOf<'_, Self>ⓘ
[src]Leaves only units in attack range of given unit.
fn in_range(self, unit: &Unit, gap: f32) -> InRange<'_, Self>ⓘ
[src]
fn in_range(self, unit: &Unit, gap: f32) -> InRange<'_, Self>ⓘ
[src]Leaves only units that are close enough to attack given unit.
fn in_real_range_of(self, unit: &Unit, gap: f32) -> InRealRangeOf<'_, Self>ⓘNotable traits for InRealRangeOf<'a, I>
impl<'a, I> Iterator for InRealRangeOf<'a, I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]
fn in_real_range_of(self, unit: &Unit, gap: f32) -> InRealRangeOf<'_, Self>ⓘNotable traits for InRealRangeOf<'a, I>
impl<'a, I> Iterator for InRealRangeOf<'a, I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]Leaves only units in attack range of given unit.
Unlike in_range_of
this takes range upgrades into account.
fn in_real_range(self, unit: &Unit, gap: f32) -> InRealRange<'_, Self>ⓘNotable traits for InRealRange<'a, I>
impl<'a, I> Iterator for InRealRange<'a, I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]
fn in_real_range(self, unit: &Unit, gap: f32) -> InRealRange<'_, Self>ⓘNotable traits for InRealRange<'a, I>
impl<'a, I> Iterator for InRealRange<'a, I> where
I: Iterator,
I::Item: Borrow<Unit>, type Item = I::Item;
[src]Leaves only units that are close enough to attack given unit.
Unlike in_range
this takes range upgrades into account.