This commit is contained in:
Lendaia Mirai
2025-09-28 13:52:26 +02:00
parent 83d76f2799
commit 7c844c32e3

View File

@@ -29,10 +29,11 @@ namespace OE.ALGA.Paradigmak
}
}
}
IEnumerator<T> IEnumerable<T>.GetEnumerator()
new public IEnumerator GetEnumerator()
{
FeltetelesFeladatTaroloBejaro<T> bejaro = new FeltetelesFeladatTaroloBejaro<T>(tarolo, n, BejaroFeltetel);
return bejaro;
return bejaro.GetEnumerator();
}
}
@@ -58,6 +59,17 @@ namespace OE.ALGA.Paradigmak
}
object IEnumerator.Current => throw new NotImplementedException();
public IEnumerator GetEnumerator()
{
foreach (T t in tarolo)
{
if (t != null && Feltetel(t))
{
yield return t;
}
}
}
public void Dispose()
{
throw new NotImplementedException();
@@ -65,6 +77,23 @@ namespace OE.ALGA.Paradigmak
public bool MoveNext()
{
// if (aktualisindex < n - 1)
// {
// aktualisindex++;
// if (Feltetel(tarolo[aktualisindex]))
// {
// return true;
// }
// else
// {
// return false;
// }
// }
// else
// {
// return false;
// }
if (aktualisindex < n - 1)
{
aktualisindex++;
@@ -72,10 +101,7 @@ namespace OE.ALGA.Paradigmak
{
return true;
}
else
{
return false;
}
return MoveNext();
}
else
{