Skip to content

Commit d13169e

Browse files
committed
Added method to get underlaying node.
1 parent 537f52e commit d13169e

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

ReClass.NET/Nodes/BitFieldNode.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,27 @@ public override void CopyFromNode(BaseNode node)
6464
Bits = node.MemorySize * 8;
6565
}
6666

67+
/// <summary>
68+
/// Gets the underlaying node for the bit field.
69+
/// </summary>
70+
/// <returns></returns>
71+
public BaseNumericNode GetUnderlayingNode()
72+
{
73+
switch (Bits)
74+
{
75+
case 8:
76+
return new UInt8Node();
77+
case 16:
78+
return new UInt16Node();
79+
case 32:
80+
return new UInt32Node();
81+
case 64:
82+
return new UInt64Node();
83+
}
84+
85+
throw new Exception(); // TODO
86+
}
87+
6788
/// <summary>Converts the memory value to a bit string.</summary>
6889
/// <param name="memory">The process memory.</param>
6990
/// <returns>The value converted to a bit string.</returns>

0 commit comments

Comments
 (0)