66using ReClassNET . AddressParser ;
77using ReClassNET . Memory ;
88using ReClassNET . UI ;
9- using ReClassNET . Util ;
109
1110namespace ReClassNET . Nodes
1211{
@@ -16,6 +15,12 @@ public class ClassNode : BaseContainerNode
1615 {
1716 public static event ClassCreatedEventHandler ClassCreated ;
1817
18+ #if WIN64
19+ public static IntPtr DefaultAddress = ( IntPtr ) 0x140000000 ;
20+ #else
21+ public static IntPtr DefaultAddress = ( IntPtr ) 0x400000 ;
22+ #endif
23+
1924 /// <summary>Size of the node in bytes.</summary>
2025 public override int MemorySize => Nodes . Sum ( n => n . MemorySize ) ;
2126
@@ -44,34 +49,27 @@ public IntPtr Address
4449 public string AddressFormula { get ; set ; }
4550
4651 public event NodeEventHandler NodesChanged ;
47-
52+
53+ internal ClassNode ( bool notifyClassCreated )
54+ : this ( notifyClassCreated , DefaultAddress )
55+ {
56+
57+ }
58+
4859 internal ClassNode ( bool notifyClassCreated , IntPtr address )
4960 {
5061 Contract . Ensures ( AddressFormula != null ) ;
5162
5263 Uuid = new NodeUuid ( true ) ;
5364
54- if ( address == IntPtr . Zero )
55- {
56- #if WIN64
57- Address = ( IntPtr ) 0x140000000 ;
58- #else
59- Address = ( IntPtr ) 0x400000 ;
60- #endif
61- }
62- else
63- Address = address ;
65+ Address = address ;
66+
6467 if ( notifyClassCreated )
6568 {
6669 ClassCreated ? . Invoke ( this ) ;
6770 }
6871 }
6972
70- internal ClassNode ( bool notifyClassCreated ) : this ( notifyClassCreated , IntPtr . Zero )
71- {
72-
73- }
74-
7573 public static ClassNode Create ( IntPtr address )
7674 {
7775 Contract . Ensures ( Contract . Result < ClassNode > ( ) != null ) ;
@@ -81,7 +79,7 @@ public static ClassNode Create(IntPtr address)
8179
8280 public static ClassNode Create ( )
8381 {
84- return Create ( IntPtr . Zero ) ;
82+ return Create ( DefaultAddress ) ;
8583 }
8684
8785 public override void Intialize ( )
0 commit comments