Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MultiSizeLabelNameDictionary.cs
Go to the documentation of this file.
2
4
5internal class MultiSizeLabelNameDictionary<TAggregator> where TAggregator : Aggregator
6{
7 private TAggregator NoLabelAggregator;
8
10
12
14
16
17 public MultiSizeLabelNameDictionary(object initialLabelNameDict)
18 {
19 NoLabelAggregator = null;
20 Label1 = null;
21 Label2 = null;
22 Label3 = null;
23 LabelMany = null;
24 if (!(initialLabelNameDict is TAggregator noLabelAggregator))
25 {
27 {
29 {
31 {
33 {
34 LabelMany = labelMany;
35 }
36 }
37 else
38 {
39 Label3 = label3;
40 }
41 }
42 else
43 {
44 Label2 = label2;
45 }
46 }
47 else
48 {
49 Label1 = label;
50 }
51 }
52 else
53 {
54 NoLabelAggregator = noLabelAggregator;
55 }
56 }
57
58 public TAggregator GetNoLabelAggregator(Func<TAggregator> createFunc)
59 {
60 if (NoLabelAggregator == null)
61 {
62 TAggregator val = createFunc();
63 if (val != null)
64 {
66 }
67 }
68 return NoLabelAggregator;
69 }
70
72 {
73 TStringSequence val = default(TStringSequence);
74 if (!(val is StringSequence1))
75 {
76 if (!(val is StringSequence2))
77 {
78 if (!(val is StringSequence3))
79 {
80 if (val is StringSequenceMany)
81 {
82 if (LabelMany == null)
83 {
85 }
87 }
88 return null;
89 }
90 if (Label3 == null)
91 {
93 }
95 }
96 if (Label2 == null)
97 {
99 }
101 }
102 if (Label1 == null)
103 {
105 }
107 }
108
109 public void Collect(Action<LabeledAggregationStatistics> visitFunc)
110 {
111 if (NoLabelAggregator != null)
112 {
114 visitFunc(new LabeledAggregationStatistics(stats));
115 }
116 Label1?.Collect(visitFunc);
117 Label2?.Collect(visitFunc);
118 Label3?.Collect(visitFunc);
119 LabelMany?.Collect(visitFunc);
120 }
121}
FixedSizeLabelNameDictionary< StringSequence2, ObjectSequence2, TAggregator > Label2
TAggregator GetNoLabelAggregator(Func< TAggregator > createFunc)
FixedSizeLabelNameDictionary< StringSequence3, ObjectSequence3, TAggregator > Label3
FixedSizeLabelNameDictionary< StringSequenceMany, ObjectSequenceMany, TAggregator > LabelMany
FixedSizeLabelNameDictionary< TStringSequence, TObjectSequence, TAggregator > GetFixedSizeLabelNameDictionary< TStringSequence, TObjectSequence >()
FixedSizeLabelNameDictionary< StringSequence1, ObjectSequence1, TAggregator > Label1
void Collect(Action< LabeledAggregationStatistics > visitFunc)
static int CompareExchange(ref int location1, int value, int comparand)