Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LabelInstructionInterpretter.cs
Go to the documentation of this file.
3
5
7{
8 private int _expectedLabelCount;
9
11
13
15
23
25 {
26 aggregator = null;
27 if (labels.Length != _expectedLabelCount)
28 {
29 return false;
30 }
31 TObjectSequence val = default(TObjectSequence);
32 if (val is ObjectSequenceMany)
33 {
34 val = (TObjectSequence)(object)new ObjectSequenceMany(new object[_expectedLabelCount]);
35 }
36 Span<object> span = val.AsSpan();
37 for (int i = 0; i < _instructions.Length; i++)
38 {
40 if (labelInstruction.LabelName != labels[labelInstruction.SourceIndex].Key)
41 {
42 return false;
43 }
44 span[i] = labels[labelInstruction.SourceIndex].Value;
45 }
47 {
49 if (aggregator == null)
50 {
51 return true;
52 }
54 }
55 return true;
56 }
57}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
TValue GetOrAdd(TKey key, Func< TKey, TValue > valueFactory)
LabelInstructionInterpretter(int expectedLabelCount, LabelInstruction[] instructions, ConcurrentDictionary< TObjectSequence, TAggregator > valuesDict, Func< TAggregator > createAggregator)
bool GetAggregator(ReadOnlySpan< KeyValuePair< string, object > > labels, out TAggregator aggregator)
ConcurrentDictionary< TObjectSequence, TAggregator > _valuesDict