Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Aggregate()

override object System.Data.Common.BooleanStorage.Aggregate ( int[] records,
AggregateType kind )
inlinevirtual

Reimplemented from System.Data.Common.DataStorage.

Definition at line 16 of file BooleanStorage.cs.

17 {
18 bool flag = false;
19 try
20 {
21 switch (kind)
22 {
23 case AggregateType.Min:
24 {
25 bool flag3 = true;
26 foreach (int num2 in records)
27 {
28 if (!IsNull(num2))
29 {
30 flag3 = _values[num2] && flag3;
31 flag = true;
32 }
33 }
34 if (flag)
35 {
36 return flag3;
37 }
38 return _nullValue;
39 }
40 case AggregateType.Max:
41 {
42 bool flag2 = false;
43 foreach (int num in records)
44 {
45 if (!IsNull(num))
46 {
47 flag2 = _values[num] || flag2;
48 flag = true;
49 }
50 }
51 if (flag)
52 {
53 return flag2;
54 }
55 return _nullValue;
56 }
57 case AggregateType.First:
58 if (records.Length != 0)
59 {
60 return _values[records[0]];
61 }
62 return null;
63 case AggregateType.Count:
64 return base.Aggregate(records, kind);
65 }
66 }
67 catch (OverflowException)
68 {
69 throw ExprException.Overflow(typeof(bool));
70 }
71 throw ExceptionBuilder.AggregateException(kind, _dataType);
72 }

References System.Data.Common.DataStorage._dataType, System.Data.Common.DataStorage._nullValue, System.Data.Common.BooleanStorage._values, System.Data.ExceptionBuilder.AggregateException(), System.Xml.Dictionary, System.Data.IsNull, and System.Data.ExprException.Overflow().