[][src]Struct semeion::env::NeighborHood

pub struct NeighborHood<'a, I: Eq + Hash + Debug, K, C, T, E> { /* fields omitted */ }

The neighbor tiles of a specific entity.

Implementations

impl<'a, I: Eq + Hash + Debug, K, C, T, E> NeighborHood<'a, I, K, C, T, E>[src]

pub fn bounds(&self) -> Bounds[src]

Gets the bounds of this neighborhood.

pub fn tiles(&self) -> &Vec<TileView<'a, I, K, C, T, E>>[src]

Gets the list of tiles included in this NeighborHood.

pub fn tile(&self, offset: Offset) -> &TileView<'a, I, K, C, T, E>[src]

Gets the tile located at the given offset from the center of this NeighborHood. The NeighborHood is seen as a Torus from this method, therefore, out of bounds offsets will be translated considering that the NeighborHood edges are joined.

pub fn center(&self) -> &TileView<'a, I, K, C, T, E>[src]

Gets the tile located in the center of this NeighborHood.

pub fn border(
    &self,
    offset: Offset,
    scope: Scope
) -> Option<Vec<&TileView<'a, I, K, C, T, E>>>
[src]

Gets a list of tiles that surround the tile T of this NeighborHood, located at a given Offset from the center tile, and according to the given Scope, that represents the distance from the tile T. The tiles are returned in arbitrary order. Returns None if any of the border tiles is out of the NeighborHood bounds for the given Scope.

Trait Implementations

impl<'a, I: Debug + Eq + Hash, K: Debug, C: Debug, T: Debug, E: Debug> Debug for NeighborHood<'a, I, K, C, T, E>[src]

impl<'a, I: Eq + Hash + Debug, K, C, T, E> From<Vec<TileView<'a, I, K, C, T, E>>> for NeighborHood<'a, I, K, C, T, E>[src]

fn from(tiles: Vec<TileView<'a, I, K, C, T, E>>) -> Self[src]

Constructs a new NeighborHood from a list of tiles that can encode a squared grid.

Auto Trait Implementations

impl<'a, I, K, C, T, E> !RefUnwindSafe for NeighborHood<'a, I, K, C, T, E>

impl<'a, I, K, C, T, E> !Send for NeighborHood<'a, I, K, C, T, E>

impl<'a, I, K, C, T, E> !Sync for NeighborHood<'a, I, K, C, T, E>

impl<'a, I, K, C, T, E> Unpin for NeighborHood<'a, I, K, C, T, E> where
    I: Unpin

impl<'a, I, K, C, T, E> !UnwindSafe for NeighborHood<'a, I, K, C, T, E>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.