|
static long | Reverse (this long value) |
|
static long | Align (this long value, int align) |
|
static long | Clamp (this long value, long min, long max) |
|
◆ Align()
static long BrawlLib.Internal.Int64Extension.Align |
( |
this long |
value, |
|
|
int |
align |
|
) |
| |
|
inlinestatic |
15 {
16 if (value < 0)
17 {
18 return 0;
19 }
20
21 if (align <= 1)
22 {
23 return value;
24 }
25
26 long temp = value % align;
27 if (temp != 0)
28 {
29 value += align - temp;
30 }
31
32 return value;
33 }
◆ Clamp()
static long BrawlLib.Internal.Int64Extension.Clamp |
( |
this long |
value, |
|
|
long |
min, |
|
|
long |
max |
|
) |
| |
|
inlinestatic |
36 {
37 if (value <= min)
38 {
39 return min;
40 }
41
42 if (value >= max)
43 {
44 return max;
45 }
46
47 return value;
48 }
◆ Reverse()
static long BrawlLib.Internal.Int64Extension.Reverse |
( |
this long |
value | ) |
|
|
inlinestatic |
6 {
7 return
8 ((value >> 56) & 0xFF) | ((value & 0xFF) << 56) |
9 ((value >> 40) & 0xFF00) | ((value & 0xFF00) << 40) |
10 ((value >> 24) & 0xFF0000) | ((value & 0xFF0000) << 24) |
11 ((value >> 8) & 0xFF000000) | ((value & 0xFF000000) << 8);
12 }
The documentation for this class was generated from the following file:
- BrawlLib/Internal/Int64Extension.cs