[−][src]Struct semeion::env::Neighborhood
The neighbor tiles of a specific Entity.
Implementations
impl<'a, 'e, K, C> Neighborhood<'a, 'e, K, C>
[src]
pub fn dimension(&self) -> Dimension
[src]
Gets the dimension of this neighborhood.
pub fn tiles(&self) -> impl Iterator<Item = &TileView<'a, 'e, K, C>>
[src]
Gets an iterator over all the Tiles that belong to this Neighborhood.
pub fn tiles_mut(&mut self) -> impl Iterator<Item = &mut TileView<'a, 'e, K, C>>
[src]
Gets an iterator over all the mutable Tiles that belong to this Neighborhood.
pub fn tile(&self, offset: impl Into<Offset>) -> &TileView<'a, 'e, K, C>
[src]
Gets a reference to 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 tile_mut(
&mut self,
offset: impl Into<Offset>
) -> &mut TileView<'a, 'e, K, C>
[src]
&mut self,
offset: impl Into<Offset>
) -> &mut TileView<'a, 'e, K, C>
Gets a mutable reference to 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, 'e, K, C>
[src]
Gets a reference to the Tile located in the center of this Neighborhood.
pub fn center_mut(&mut self) -> &mut TileView<'a, 'e, K, C>
[src]
Gets a mutable reference to the Tile located in the center of this Neighborhood.
pub fn border(
&self,
offset: impl Into<Offset>,
scope: impl Into<Scope>
) -> Option<Vec<&TileView<'a, 'e, K, C>>>
[src]
&self,
offset: impl Into<Offset>,
scope: impl Into<Scope>
) -> Option<Vec<&TileView<'a, 'e, K, C>>>
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 beyond the Neighborhood dimension for the given Scope.
pub fn immediate_border(
&self,
scope: impl Into<Scope>
) -> Option<Vec<&TileView<'a, 'e, K, C>>>
[src]
&self,
scope: impl Into<Scope>
) -> Option<Vec<&TileView<'a, 'e, K, C>>>
Gets a list of tiles that surround the center Tile of this Neighborhood, and according to the given Scope, that represents the distance from the center Tile.
The tiles are returned in arbitrary order. Returns None if any of the border tiles is beyond the Neighborhood dimension for the given Scope.
impl<'a, 'e, K: PartialEq, C> Neighborhood<'a, 'e, K, C>
[src]
pub fn contains_kind(&self, kind: K) -> bool
[src]
Returns true only if any of the Tiles in this Neighborhood contains an Entity of the given Kind, without considering the Entity that is inspecting this Neighborhood.
Trait Implementations
impl<'a, 'e, K: Debug, C: Debug> Debug for Neighborhood<'a, 'e, K, C>
[src]
impl<'a, 'e, K, C> From<Vec<TileView<'a, 'e, K, C>, Global>> for Neighborhood<'a, 'e, K, C>
[src]
Auto Trait Implementations
impl<'a, 'e, K, C> !RefUnwindSafe for Neighborhood<'a, 'e, K, C>
impl<'a, 'e, K, C> !Send for Neighborhood<'a, 'e, K, C>
impl<'a, 'e, K, C> !Sync for Neighborhood<'a, 'e, K, C>
impl<'a, 'e, K, C> Unpin for Neighborhood<'a, 'e, K, C> where
'e: 'a,
'e: 'a,
impl<'a, 'e, K, C> !UnwindSafe for Neighborhood<'a, 'e, K, C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,