Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SynchronousChannelMergeEnumerator.cs
Go to the documentation of this file.
2
4{
5 private readonly SynchronousChannel<T>[] _channels;
6
7 private int _channelIndex;
8
9 private T _currentElement;
10
11 public override T Current
12 {
13 get
14 {
15 if (_channelIndex == -1 || _channelIndex == _channels.Length)
16 {
18 }
19 return _currentElement;
20 }
21 }
22
24 : base(taskGroupState)
25 {
26 _channels = channels;
27 _channelIndex = -1;
28 }
29
30 public override bool MoveNext()
31 {
32 if (_channelIndex == -1)
33 {
34 _channelIndex = 0;
35 }
36 while (_channelIndex != _channels.Length)
37 {
38 SynchronousChannel<T> synchronousChannel = _channels[_channelIndex];
39 if (synchronousChannel.Count == 0)
40 {
42 continue;
43 }
44 _currentElement = synchronousChannel.Dequeue();
45 return true;
46 }
47 return false;
48 }
49}
SynchronousChannelMergeEnumerator(QueryTaskGroupState taskGroupState, SynchronousChannel< T >[] channels)
static string PLINQ_CommonEnumerator_Current_NotStarted
Definition SR.cs:24
Definition SR.cs:7