Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DecimalAggregator.cs
Go to the documentation of this file.
1
using
System.ComponentModel
;
2
3
namespace
System.Xml.Xsl.Runtime
;
4
5
[
EditorBrowsable
(
EditorBrowsableState
.Never)]
6
public
struct
DecimalAggregator
7
{
8
private
decimal
_result
;
9
10
private
int
_cnt
;
11
12
public
decimal
SumResult
=>
_result
;
13
14
public
decimal
AverageResult
=>
_result
/ (decimal)
_cnt
;
15
16
public
decimal
MinimumResult
=>
_result
;
17
18
public
decimal
MaximumResult
=>
_result
;
19
20
public
bool
IsEmpty
=>
_cnt
== 0;
21
22
public
void
Create
()
23
{
24
_cnt
= 0;
25
}
26
27
public
void
Sum
(decimal
value
)
28
{
29
if
(
_cnt
== 0)
30
{
31
_result
=
value
;
32
_cnt
= 1;
33
}
34
else
35
{
36
_result
+=
value
;
37
}
38
}
39
40
public
void
Average
(decimal
value
)
41
{
42
if
(
_cnt
== 0)
43
{
44
_result
=
value
;
45
}
46
else
47
{
48
_result
+=
value
;
49
}
50
_cnt
++;
51
}
52
53
public
void
Minimum
(decimal
value
)
54
{
55
if
(
_cnt
== 0 ||
value
<
_result
)
56
{
57
_result
=
value
;
58
}
59
_cnt
= 1;
60
}
61
62
public
void
Maximum
(decimal
value
)
63
{
64
if
(
_cnt
== 0 ||
value
>
_result
)
65
{
66
_result
=
value
;
67
}
68
_cnt
= 1;
69
}
70
}
System.ComponentModel.EditorBrowsableState
EditorBrowsableState
Definition
EditorBrowsableState.cs:4
System.ComponentModel
Definition
ColumnAttribute.cs:3
System.Xml.Xsl.Runtime
Definition
AncestorDocOrderIterator.cs:4
System.Xml.ValueHandleType.Dictionary
@ Dictionary
System.ExceptionArgument.value
@ value
System.Xml.Xsl.Runtime.DecimalAggregator.Maximum
void Maximum(decimal value)
Definition
DecimalAggregator.cs:62
System.Xml.Xsl.Runtime.DecimalAggregator._cnt
int _cnt
Definition
DecimalAggregator.cs:10
System.Xml.Xsl.Runtime.DecimalAggregator.Average
void Average(decimal value)
Definition
DecimalAggregator.cs:40
System.Xml.Xsl.Runtime.DecimalAggregator.MinimumResult
decimal MinimumResult
Definition
DecimalAggregator.cs:16
System.Xml.Xsl.Runtime.DecimalAggregator.AverageResult
decimal AverageResult
Definition
DecimalAggregator.cs:14
System.Xml.Xsl.Runtime.DecimalAggregator.SumResult
decimal SumResult
Definition
DecimalAggregator.cs:12
System.Xml.Xsl.Runtime.DecimalAggregator.IsEmpty
bool IsEmpty
Definition
DecimalAggregator.cs:20
System.Xml.Xsl.Runtime.DecimalAggregator._result
decimal _result
Definition
DecimalAggregator.cs:8
System.Xml.Xsl.Runtime.DecimalAggregator.Sum
void Sum(decimal value)
Definition
DecimalAggregator.cs:27
System.Xml.Xsl.Runtime.DecimalAggregator.Create
void Create()
Definition
DecimalAggregator.cs:22
System.Xml.Xsl.Runtime.DecimalAggregator.MaximumResult
decimal MaximumResult
Definition
DecimalAggregator.cs:18
System.Xml.Xsl.Runtime.DecimalAggregator.Minimum
void Minimum(decimal value)
Definition
DecimalAggregator.cs:53
System.Xml.Xsl.Runtime.DecimalAggregator
Definition
DecimalAggregator.cs:7
source
System.Private.Xml
System.Xml.Xsl.Runtime
DecimalAggregator.cs
Generated by
1.10.0