Struct SurroundingRegionsIterator
Iterate through a region list starting at a position and moving outwards.
public struct SurroundingRegionsIterator : IEnumerator<RegionCoord>, IEnumerator, IDisposable, IEnumerable<RegionCoord>, IEnumerable
- Implements
-
IEnumerator<RegionCoord>IEnumerable<RegionCoord>
- Inherited Members
- Extension Methods
Remarks
Stolen from DevkitServer.
Constructors
SurroundingRegionsIterator(byte, byte, byte)
public SurroundingRegionsIterator(byte x, byte y, byte maxRegionDistance = 255)
Parameters
Fields
MaxRegionDistance
public readonly byte MaxRegionDistance
Field Value
StartX
public readonly byte StartX
Field Value
StartY
public readonly byte StartY
Field Value
Properties
Current
Gets the element in the collection at the current position of the enumerator.
public RegionCoord Current { get; }
Property Value
- RegionCoord
The element in the collection at the current position of the enumerator.
Methods
GetEnumerator()
public readonly SurroundingRegionsIterator GetEnumerator()
Returns
MoveNext()
Advances the enumerator to the next element of the collection.
public bool MoveNext()
Returns
- bool
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
Exceptions
- InvalidOperationException
The collection was modified after the enumerator was created.
Reset()
Sets the enumerator to its initial position, which is before the first element in the collection.
public void Reset()
Exceptions
- InvalidOperationException
The collection was modified after the enumerator was created.