Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LabelInstructionCompiler.cs
Go to the documentation of this file.
3
5
6internal static class LabelInstructionCompiler
7{
9 {
11 Array.Sort(array, (LabelInstruction a, LabelInstruction b) => string.CompareOrdinal(a.LabelName, b.LabelName));
12 int expectedLabels = labels.Length;
13 switch (array.Length)
14 {
15 case 0:
16 {
17 TAggregator defaultAggregator = aggregatorStore.GetAggregator();
19 {
20 if (l.Length != expectedLabels)
21 {
22 aggregator = null;
23 return false;
24 }
26 return true;
27 };
28 }
29 case 1:
30 {
31 StringSequence1 names2 = new StringSequence1(array[0].LabelName);
34 return object2.GetAggregator;
35 }
36 case 2:
37 {
38 StringSequence2 names4 = new StringSequence2(array[0].LabelName, array[1].LabelName);
41 return object4.GetAggregator;
42 }
43 case 3:
44 {
45 StringSequence3 names3 = new StringSequence3(array[0].LabelName, array[1].LabelName, array[2].LabelName);
48 return object3.GetAggregator;
49 }
50 default:
51 {
52 string[] array2 = new string[array.Length];
53 for (int i = 0; i < array.Length; i++)
54 {
55 array2[i] = array[i].LabelName;
56 }
60 return @object.GetAggregator;
61 }
62 }
63 }
64
66 {
68 for (int i = 0; i < labels.Length; i++)
69 {
70 array[i] = new LabelInstruction(i, labels[i].Key);
71 }
72 return array;
73 }
74}
static void Sort(Array array)
Definition Array.cs:2329
static AggregatorLookupFunc< TAggregator > Create< TAggregator >(ref AggregatorStore< TAggregator > aggregatorStore, Func< TAggregator > createAggregatorFunc, ReadOnlySpan< KeyValuePair< string, object > > labels)
static LabelInstruction[] Compile(ReadOnlySpan< KeyValuePair< string, object > > labels)