Skip to content

Commit 4ed8a47

Browse files
committed
EnumeratorPlugin created
1 parent b94a686 commit 4ed8a47

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// public class EnumeratorPlugin<T> : IRandomizerPlugin<T>
2+
// {
3+
// private readonly IEnumerable<T> _enumerable;
4+
// private IEnumerator<T> _enumerator;
5+
6+
7+
// public EnumeratorPlugin(IEnumerable<T> enumerable)
8+
// {
9+
// _enumerable = enumerable;
10+
// }
11+
12+
// public T GetValue()
13+
// {
14+
// // First time?
15+
// if (_enumerator == null)
16+
// {
17+
// _enumerator = _enumerable.GetEnumerator();
18+
// }
19+
20+
// // Advance, try to recover if we hit end-of-enumeration
21+
// var hasNext = _enumerator.MoveNext();
22+
// if (!hasNext)
23+
// {
24+
// _enumerator = _enumerable.GetEnumerator();
25+
// hasNext = _enumerator.MoveNext();
26+
27+
// if (!hasNext)
28+
// {
29+
// throw new Exception("Unable to get next value from enumeration " + _enumerable);
30+
// }
31+
// }
32+
33+
// return _enumerator.Current;
34+
// }
35+
// }

0 commit comments

Comments
 (0)