Show / Hide Table of Contents

Struct ReadOnlyLayeredSpatialMapItemsAtEnumerator<T>

A custom enumerator used to iterate over all positions at a given location in a layered spatial map implementation efficiently.

Generally, you should use GetItemsAt(Point, uint) (or one of its overloads) to get an instance of this, rather than creating one yourself.

Implements
IEnumerable<T>
IEnumerable
IEnumerator<T>
IEnumerator
IDisposable
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: SadRogue.Primitives.SpatialMaps
Assembly: TheSadRogue.Primitives.dll
Syntax
public struct ReadOnlyLayeredSpatialMapItemsAtEnumerator<T> : IEnumerable<T>, IEnumerable, IEnumerator<T>, IEnumerator, IDisposable where T : IHasLayer
Type Parameters
Name Description
T
Remarks

This type is a struct, and as such is notably more efficient when used in a foreach loop than a function returning IEnumerable<T> by using "yield return". This type does implement IEnumerable<T>, so you can pass it to functions which require one (for example, System.LINQ). However, this will have reduced performance due to boxing of the iterator.

Constructors

View Source

ReadOnlyLayeredSpatialMapItemsAtEnumerator(IReadOnlyLayeredSpatialMap<T>, Point, uint)

Creates an enumerator which iterates over all items at the given point in the spatial map given, which are on layers in the given layer mask.

Declaration
public ReadOnlyLayeredSpatialMapItemsAtEnumerator(IReadOnlyLayeredSpatialMap<T> map, Point position, uint layerMask)
Parameters
Type Name Description
IReadOnlyLayeredSpatialMap<T> map

The spatial map to check for items in.

Point position

The position to retrieve items at.

uint layerMask

The layer mask specifying layers to check.

Properties

View Source

Current

The current value for enumeration.

Declaration
public T Current { get; }
Property Value
Type Description
T

Methods

View Source

GetEnumerator()

Returns this enumerator.

Declaration
public ReadOnlyLayeredSpatialMapItemsAtEnumerator<T> GetEnumerator()
Returns
Type Description
ReadOnlyLayeredSpatialMapItemsAtEnumerator<T>

This enumerator.

View Source

MoveNext()

Advances the iterator to the next item.

Declaration
public bool MoveNext()
Returns
Type Description
bool

True if the a new item at the position given within the specified layers; false otherwise.

Implements

IEnumerable<T>
IEnumerable
IEnumerator<T>
IEnumerator
IDisposable

Extension Methods

PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?)
PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?, EventHandler<ValueChangedEventArgs<TProperty>>?)
ToStringExtensions.ExtendToString<T>(IEnumerable<T>, string, Func<T, string>?, string, string)
  • View Source
In this article
Back to top Generated by DocFX