Show / Hide Table of Contents

Struct SpatialMapItemsAtEnumerator<T>

A custom enumerator used to iterate over the item at a given location in a spatial map implementation efficiently.

Generally, you should use GetItemsAt(Point) (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 SpatialMapItemsAtEnumerator<T> : IEnumerable<T>, IEnumerable, IEnumerator<T>, IEnumerator, IDisposable where T : notnull
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

SpatialMapItemsAtEnumerator(AdvancedSpatialMap<T>, Point)

Creates an enumerator which iterates over all items at the given point in the spatial map given.

Declaration
public SpatialMapItemsAtEnumerator(AdvancedSpatialMap<T> map, Point position)
Parameters
Type Name Description
AdvancedSpatialMap<T> map

The spatial map to check for items in.

Point position

The position to retrieve items at.

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 SpatialMapItemsAtEnumerator<T> GetEnumerator()
Returns
Type Description
SpatialMapItemsAtEnumerator<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; 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