Fix ActorTable Enumerator

This commit is contained in:
Caraxi 2020-05-28 08:44:41 +09:30
parent 4bbcd526e9
commit e95dfa8320

View file

@ -85,34 +85,10 @@ namespace Dalamud.Game.ClientState.Actors {
}
}
private class ActorTableEnumerator : IEnumerator<Actor> {
private readonly ActorTable table;
private int currentIndex;
public ActorTableEnumerator(ActorTable table) {
this.table = table;
}
public bool MoveNext() {
this.currentIndex++;
return this.currentIndex != this.table.Length;
}
public void Reset() {
this.currentIndex = 0;
}
public Actor Current => this.table[this.currentIndex];
object IEnumerator.Current => Current;
// Required by IEnumerator<T> even though we have nothing we want to dispose here.
public void Dispose() {}
}
public IEnumerator<Actor> GetEnumerator() {
return new ActorTableEnumerator(this);
for (int i=0;i<Length;i++){
yield return this[i];
}
}
IEnumerator IEnumerable.GetEnumerator() {