Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HashLookupBuilder.cs
Go to the documentation of this file.
2
4
5internal abstract class HashLookupBuilder<TElement, TOrderKey, THashKey>
6{
7 protected interface IBaseHashBuilder<TBaseElement, TBaseOrderKey>
8 {
9 bool Add(THashKey hashKey, TBaseElement element, TBaseOrderKey orderKey);
10 }
11
13
15 {
17 TBaseOrderKey currentKey = default(TBaseOrderKey);
18 int num = 0;
19 while (dataSource.MoveNext(ref currentElement, ref currentKey))
20 {
21 if ((num++ & 0x3F) == 0)
22 {
23 cancellationToken.ThrowIfCancellationRequested();
24 }
25 TBaseElement first = currentElement.First;
26 THashKey second = currentElement.Second;
27 if (second != null)
28 {
29 baseHashBuilder.Add(second, first, currentKey);
30 }
31 }
32 }
33
34 public void Dispose()
35 {
36 Dispose(disposing: true);
37 }
38
39 protected virtual void Dispose(bool disposing)
40 {
41 }
42}
HashJoinHashLookup< THashKey, TElement, TOrderKey > BuildHashLookup(CancellationToken cancellationToken)
void BuildBaseHashLookup< TBaseBuilder, TBaseElement, TBaseOrderKey >(QueryOperatorEnumerator< Pair< TBaseElement, THashKey >, TBaseOrderKey > dataSource, TBaseBuilder baseHashBuilder, CancellationToken cancellationToken)
virtual void Dispose(bool disposing)
bool Add(THashKey hashKey, TBaseElement element, TBaseOrderKey orderKey)