Struct TileView

Source
pub struct TileView<'a, 'e, K, C> { /* private fields */ }
Expand description

A single Environment tile as seen by a single Entity.

Implementations§

Source§

impl<'a, 'e, K, C> TileView<'a, 'e, K, C>

Source

pub fn location(&self) -> Location

Gets the Location of this Tile within the Environment.

Source

pub fn entities(&self) -> impl Iterator<Item = &EntityTrait<'e, K, C>>

Gets an iterator over all the entities located in this Tile that does not include the Entity that is seeing the tile.

The entities are returned in arbitrary order.

Source

pub fn entities_mut( &mut self, ) -> impl Iterator<Item = &mut EntityTrait<'e, K, C>>

Gets an iterator over all the mutable entities located in this Tile that does not include the Entity that is seeing the tile.

The entities are returned in arbitrary order.

Source

pub fn count(&self) -> usize

Gets the total number of entities located in this Tile, including the Entity that is seeing the tile.

Source

pub fn is_empty(&self) -> bool

Returns true only if there are no entities located in this tile.

Source§

impl<'a, 'e, K: PartialEq, C> TileView<'a, 'e, K, C>

Source

pub fn contains_kind(&self, kind: K) -> bool

Returns true only if this Tile contains an Entity of the given Kind, without considering the Entity that is seeing the tile.

Source

pub fn count_kind(&self, kind: K) -> usize

Gets the total number of entities in this Tile of the given Kind, without considering the Entity that is seeing the tile.

Trait Implementations§

Source§

impl<'a, 'e, K: Debug, C: Debug> Debug for TileView<'a, 'e, K, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, 'e, K, C> Freeze for TileView<'a, 'e, K, C>

§

impl<'a, 'e, K, C> !RefUnwindSafe for TileView<'a, 'e, K, C>

§

impl<'a, 'e, K, C> !Send for TileView<'a, 'e, K, C>

§

impl<'a, 'e, K, C> !Sync for TileView<'a, 'e, K, C>

§

impl<'a, 'e, K, C> Unpin for TileView<'a, 'e, K, C>

§

impl<'a, 'e, K, C> !UnwindSafe for TileView<'a, 'e, K, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.