BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
BrawlLib.Internal.BInt24 Struct Reference

Public Member Functions

 BInt24 (int value)
 
 BInt24 (byte v0, byte v1, byte v2)
 

Static Public Member Functions

static operator int (BInt24 val)
 
static operator BInt24 (int val)
 
static operator uint (BInt24 val)
 
static operator BInt24 (uint val)
 

Public Attributes

byte _dat0
 
byte _dat1
 
byte _dat2
 

Properties

byte this[int index] [get, set]
 
int Value [get, set]
 
VoidPtr Address [get]
 

Constructor & Destructor Documentation

◆ BInt24() [1/2]

BrawlLib.Internal.BInt24.BInt24 ( int  value)
inline
75 {
76 _dat2 = (byte) (value & 0xFF);
77 _dat1 = (byte) ((value >> 8) & 0xFF);
78 _dat0 = (byte) ((value >> 16) & 0x7F);
79 if (value < 0)
80 {
81 _dat0 |= 0x80;
82 }
83 }
byte _dat0
Definition: Int24.cs:8
byte _dat1
Definition: Int24.cs:8
byte _dat2
Definition: Int24.cs:8

◆ BInt24() [2/2]

BrawlLib.Internal.BInt24.BInt24 ( byte  v0,
byte  v1,
byte  v2 
)
inline
86 {
87 _dat2 = v2;
88 _dat1 = v1;
89 _dat0 = v0;
90 }

Member Function Documentation

◆ operator BInt24() [1/2]

static BrawlLib.Internal.BInt24.operator BInt24 ( int  val)
inlineexplicitstatic
60 {
61 return new BInt24(val);
62 }
BInt24(int value)
Definition: Int24.cs:74

◆ operator BInt24() [2/2]

static BrawlLib.Internal.BInt24.operator BInt24 ( uint  val)
inlineexplicitstatic
70 {
71 return new BInt24((int) val);
72 }

◆ operator int()

static BrawlLib.Internal.BInt24.operator int ( BInt24  val)
inlineexplicitstatic
55 {
56 return val.Value;
57 }

◆ operator uint()

static BrawlLib.Internal.BInt24.operator uint ( BInt24  val)
inlineexplicitstatic
65 {
66 return (uint) val.Value;
67 }

Member Data Documentation

◆ _dat0

byte BrawlLib.Internal.BInt24._dat0

◆ _dat1

byte BrawlLib.Internal.BInt24._dat1

◆ _dat2

byte BrawlLib.Internal.BInt24._dat2

Property Documentation

◆ Address

VoidPtr BrawlLib.Internal.BInt24.Address
get
93 {
94 get
95 {
96 fixed (void* ptr = &this)
97 {
98 return ptr;
99 }
100 }
101 }

◆ this[int index]

byte BrawlLib.Internal.BInt24.this[int index]
getset
11 {
12 get
13 {
14 switch (index)
15 {
16 case 0: return _dat0;
17 case 1: return _dat1;
18 case 2: return _dat2;
19 default: return 0;
20 }
21 }
22 set
23 {
24 switch (index)
25 {
26 case 0:
27 _dat0 = value;
28 break;
29 case 1:
30 _dat1 = value;
31 break;
32 case 2:
33 _dat2 = value;
34 break;
35 }
36 }
37 }

◆ Value

int BrawlLib.Internal.BInt24.Value
getset
40 {
41 get => (((_dat0 & 0x7F) << 16) | (_dat1 << 8) | _dat2) * ((_dat0 & 0x80) == 0x80 ? -1 : 1);
42 set
43 {
44 _dat2 = (byte) (value & 0xFF);
45 _dat1 = (byte) ((value >> 8) & 0xFF);
46 _dat0 = (byte) ((value >> 16) & 0x7F);
47 if (value < 0)
48 {
49 _dat0 |= 0x80;
50 }
51 }
52 }

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