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>

Notable traits for FindTags<'a, I, T>

impl<'a, I, T> Iterator for FindTags<'a, I, T> where
    I: Iterator,
    I::Item: Borrow<Unit>,
    T: Container<u64>, 
type Item = I::Item;
{ ... }
fn of_type(self, unit_type: UnitTypeId) -> OfType<Self>

Notable traits for OfType<I>

impl<I> Iterator for OfType<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
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;
{ ... }
fn of_types<T: Container<UnitTypeId>>(
        self,
        types: &T
    ) -> OfTypes<'_, Self, T>

Notable traits for OfTypes<'a, I, T>

impl<'a, I, T> Iterator for OfTypes<'a, I, T> where
    I: Iterator,
    I::Item: Borrow<Unit>,
    T: Container<UnitTypeId>, 
type Item = I::Item;
{ ... }
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;
{ ... }
fn ground(self) -> Ground<Self>

Notable traits for Ground<I>

impl<I> Iterator for Ground<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
fn flying(self) -> Flying<Self>

Notable traits for Flying<I>

impl<I> Iterator for Flying<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
fn ready(self) -> Ready<Self>

Notable traits for Ready<I>

impl<I> Iterator for Ready<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
fn not_ready(self) -> NotReady<Self>

Notable traits for NotReady<I>

impl<I> Iterator for NotReady<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
fn idle(self) -> Idle<Self>

Notable traits for Idle<I>

impl<I> Iterator for Idle<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
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;
{ ... }
fn unused(self) -> Unused<Self>

Notable traits for Unused<I>

impl<I> Iterator for Unused<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
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;
{ ... }
fn visible(self) -> Visible<Self>

Notable traits for Visible<I>

impl<I> Iterator for Visible<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
fn in_range_of(self, unit: &Unit, gap: f32) -> InRangeOf<'_, Self>

Notable traits for InRangeOf<'a, I>

impl<'a, I> Iterator for InRangeOf<'a, I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
fn in_range(self, unit: &Unit, gap: f32) -> InRange<'_, Self>

Notable traits for InRange<'a, I>

impl<'a, I> Iterator for InRange<'a, I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
{ ... }
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;
{ ... }
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;
{ ... }
}
Expand description

Helper trait for iterators over units.

Provided methods

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>

Notable traits for FindTags<'a, I, T>

impl<'a, I, T> Iterator for FindTags<'a, I, T> where
    I: Iterator,
    I::Item: Borrow<Unit>,
    T: Container<u64>, 
type Item = I::Item;
[src]

Leaves only units with given tags.

fn of_type(self, unit_type: UnitTypeId) -> OfType<Self>

Notable traits for OfType<I>

impl<I> Iterator for OfType<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[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]

Excludes units of given type.

fn of_types<T: Container<UnitTypeId>>(self, types: &T) -> OfTypes<'_, Self, T>

Notable traits for OfTypes<'a, I, T>

impl<'a, I, T> Iterator for OfTypes<'a, I, T> where
    I: Iterator,
    I::Item: Borrow<Unit>,
    T: Container<UnitTypeId>, 
type Item = I::Item;
[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]

Excludes units of given types.

fn ground(self) -> Ground<Self>

Notable traits for Ground<I>

impl<I> Iterator for Ground<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[src]

Leaves only non-flying units.

fn flying(self) -> Flying<Self>

Notable traits for Flying<I>

impl<I> Iterator for Flying<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[src]

Leaves only flying units.

fn ready(self) -> Ready<Self>

Notable traits for Ready<I>

impl<I> Iterator for Ready<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[src]

Leaves only ready structures.

fn not_ready(self) -> NotReady<Self>

Notable traits for NotReady<I>

impl<I> Iterator for NotReady<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[src]

Leaves only structures in-progress.

fn idle(self) -> Idle<Self>

Notable traits for Idle<I>

impl<I> Iterator for Idle<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[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]

Leaves only units with no orders or that almost finished their orders.

fn unused(self) -> Unused<Self>

Notable traits for Unused<I>

impl<I> Iterator for Unused<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[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]

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>

Notable traits for Visible<I>

impl<I> Iterator for Visible<I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[src]

Leaves only units visible on current step.

fn in_range_of(self, unit: &Unit, gap: f32) -> InRangeOf<'_, Self>

Notable traits for InRangeOf<'a, I>

impl<'a, I> Iterator for InRangeOf<'a, I> where
    I: Iterator,
    I::Item: Borrow<Unit>, 
type Item = I::Item;
[src]

Leaves only units in attack range of given unit.

fn in_range(self, unit: &Unit, gap: f32) -> InRange<'_, Self>

Notable traits for InRange<'a, I>

impl<'a, I> Iterator for InRange<'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.

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]

Leaves only units that are close enough to attack given unit. Unlike in_range this takes range upgrades into account.

Implementors

impl<I> UnitsIterator for I where
    I: Iterator + Sized,
    I::Item: Borrow<Unit>, 
[src]