Definition at line 1 of file MathEx.cs.
◆ ClampToInt() [1/3]
| static int MathEx.ClampToInt |
( |
long |
a | ) |
|
|
inlinestatic |
◆ ClampToInt() [2/3]
| static int MathEx.ClampToInt |
( |
long |
a, |
|
|
int |
b = int::MaxValue |
|
) |
| |
|
inlinestatic |
Definition at line 38 of file MathEx.cs.
39 {
40 if (a > b)
41 {
42 return b;
43 }
44 if (a < -b)
45 {
46 return -b;
47 }
48 return (int)a;
49 }
◆ ClampToInt() [3/3]
| static int MathEx.ClampToInt |
( |
long |
a, |
|
|
int |
min, |
|
|
int |
max |
|
) |
| |
|
inlinestatic |
Definition at line 51 of file MathEx.cs.
52 {
53 if (a > max)
54 {
55 return max;
56 }
57 if (a < min)
58 {
59 return min;
60 }
61 return (int)a;
62 }
◆ IntIDOverflowTempFix()
| static int MathEx.IntIDOverflowTempFix |
( |
int |
a | ) |
|
|
inlinestatic |
◆ IsSameSign()
| static bool MathEx.IsSameSign |
( |
int |
a, |
|
|
int |
b |
|
) |
| |
|
inlinestatic |
Definition at line 12 of file MathEx.cs.
13 {
14 if (a < 0 || b < 0)
15 {
16 if (a < 0)
17 {
18 return b < 0;
19 }
20 return false;
21 }
22 return true;
23 }
Referenced by ActEffect.Proc().
◆ Max()
| static long MathEx.Max |
( |
long |
a, |
|
|
long |
b |
|
) |
| |
|
inlinestatic |
The documentation for this class was generated from the following file: