Elin Decompiled Documentation EA 23.300 Nightly
Loading...
Searching...
No Matches
MathEx Class Reference

Static Public Member Functions

static bool IsSameSign (int a, int b)
 
static int ClampToInt (long a)
 
static int ClampToInt (long a, int b=int.MaxValue)
 
static long Max (long a, long b)
 

Detailed Description

Definition at line 1 of file MathEx.cs.

Member Function Documentation

◆ ClampToInt() [1/2]

static int MathEx.ClampToInt ( long  a)
inlinestatic

Definition at line 16 of file MathEx.cs.

17 {
18 if (a > int.MaxValue)
19 {
20 return int.MaxValue;
21 }
22 if (a < int.MinValue)
23 {
24 return int.MinValue;
25 }
26 return (int)a;
27 }

Referenced by QuestRandom.OnDropReward(), ActZap.Perform(), and EClass.rnd().

◆ ClampToInt() [2/2]

static int MathEx.ClampToInt ( long  a,
int  b = int::MaxValue 
)
inlinestatic

Definition at line 29 of file MathEx.cs.

30 {
31 if (a > b)
32 {
33 return b;
34 }
35 if (a < -b)
36 {
37 return -b;
38 }
39 return (int)a;
40 }

◆ IsSameSign()

static bool MathEx.IsSameSign ( int  a,
int  b 
)
inlinestatic

Definition at line 3 of file MathEx.cs.

4 {
5 if (a < 0 || b < 0)
6 {
7 if (a < 0)
8 {
9 return b < 0;
10 }
11 return false;
12 }
13 return true;
14 }

Referenced by ActEffect.Proc().

◆ Max()

static long MathEx.Max ( long  a,
long  b 
)
inlinestatic

Definition at line 42 of file MathEx.cs.

43 {
44 if (a >= b)
45 {
46 return a;
47 }
48 return b;
49 }

Referenced by Ability.GetPower().


The documentation for this class was generated from the following file: