Table of Contents

Struct ListRegionsEnumerator<T>

Namespace
Uncreated.Warfare.Util.Region
Assembly
Uncreated.Warfare.dll

Iterate through a region list.

public struct ListRegionsEnumerator<T> : IEnumerable<T>, IEnumerable, IEnumerator<T>, IEnumerator, IDisposable

Type Parameters

T
Implements
Inherited Members
Extension Methods

Remarks

Stolen from DevkitServer.

Constructors

ListRegionsEnumerator(List<T>[,])

public ListRegionsEnumerator(List<T>[,] regions)

Parameters

regions List<T>[,]

ListRegionsEnumerator(List<T>[,], byte, byte, byte)

public ListRegionsEnumerator(List<T>[,] regions, byte centerX, byte centerY, byte maxRegionDistance = 255)

Parameters

regions List<T>[,]
centerX byte
centerY byte
maxRegionDistance byte

Fields

Coordinate

public RegionCoord Coordinate

Field Value

RegionCoord

Properties

Current

Gets the element in the collection at the current position of the enumerator.

public T Current { get; }

Property Value

T

The element in the collection at the current position of the enumerator.

Index

public int Index { get; }

Property Value

int

Region

public List<T>? Region { get; }

Property Value

List<T>

Regions

public List<T>[,] Regions { get; }

Property Value

List<T>[,]

Methods

GetEnumerator()

public readonly ListRegionsEnumerator<T> GetEnumerator()

Returns

ListRegionsEnumerator<T>

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.