Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Range.cs
Go to the documentation of this file.
1
namespace
System.Data
;
2
3
internal
struct
Range
4
{
5
private
readonly
int
_min
;
6
7
private
readonly
int
_max
;
8
9
private
readonly
bool
_isNotNull
;
10
11
public
int
Count
12
{
13
get
14
{
15
if
(!
IsNull
)
16
{
17
return
_max
-
_min
+ 1;
18
}
19
return
0;
20
}
21
}
22
23
public
bool
IsNull
=> !
_isNotNull
;
24
25
public
int
Max
26
{
27
get
28
{
29
CheckNull
();
30
return
_max
;
31
}
32
}
33
34
public
int
Min
35
{
36
get
37
{
38
CheckNull
();
39
return
_min
;
40
}
41
}
42
43
public
Range
(
int
min,
int
max)
44
{
45
if
(min > max)
46
{
47
throw
ExceptionBuilder
.
RangeArgument
(min, max);
48
}
49
_min
= min;
50
_max
= max;
51
_isNotNull
=
true
;
52
}
53
54
internal
void
CheckNull
()
55
{
56
if
(
IsNull
)
57
{
58
throw
ExceptionBuilder
.
NullRange
();
59
}
60
}
61
}
System.Data.ExceptionBuilder.NullRange
static Exception NullRange()
Definition
ExceptionBuilder.cs:1226
System.Data.ExceptionBuilder.RangeArgument
static Exception RangeArgument(int min, int max)
Definition
ExceptionBuilder.cs:1221
System.Data.ExceptionBuilder
Definition
ExceptionBuilder.cs:8
System.Data
Definition
ADP.cs:12
System.Data.Range._max
readonly int _max
Definition
Range.cs:7
System.Data.Range._min
readonly int _min
Definition
Range.cs:5
System.Data.Range._isNotNull
readonly bool _isNotNull
Definition
Range.cs:9
System.Data.Range.Min
int Min
Definition
Range.cs:35
System.Data.Range.CheckNull
void CheckNull()
Definition
Range.cs:54
System.Data.Range.Max
int Max
Definition
Range.cs:26
System.Data.Range.IsNull
bool IsNull
Definition
Range.cs:23
System.Data.Range.Range
Range(int min, int max)
Definition
Range.cs:43
System.Data.Range.Count
int Count
Definition
Range.cs:12
System.Data.Range
Definition
Range.cs:4
source
System.Data.Common
System.Data
Range.cs
Generated by
1.10.0