BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BrawlLib.Internal.UInt64Extension Class Reference

Static Public Member Functions

static ulong Reverse (this ulong value)
 
static ulong Align (this ulong value, uint align)
 
static ulong Clamp (this ulong value, ulong min, ulong max)
 

Member Function Documentation

◆ Align()

static ulong BrawlLib.Internal.UInt64Extension.Align ( this ulong  value,
uint  align 
)
inlinestatic
15 {
16 if (value < 0)
17 {
18 return 0;
19 }
20
21 if (align <= 1)
22 {
23 return value;
24 }
25
26 ulong temp = value % align;
27 if (temp != 0)
28 {
29 value += align - temp;
30 }
31
32 return value;
33 }

◆ Clamp()

static ulong BrawlLib.Internal.UInt64Extension.Clamp ( this ulong  value,
ulong  min,
ulong  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 ulong BrawlLib.Internal.UInt64Extension.Reverse ( this ulong  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: