Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Object.cs
Go to the documentation of this file.
4
5namespace System;
6
8[ClassInterface(ClassInterfaceType.AutoDispatch)]
9[ComVisible(true)]
10[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
11public class Object
12{
13 [MethodImpl(MethodImplOptions.InternalCall)]
14 [Intrinsic]
15 public extern Type GetType();
16
17 [Intrinsic]
18 protected unsafe object MemberwiseClone()
19 {
21 nuint rawObjectDataSize = RuntimeHelpers.GetRawObjectDataSize(obj);
22 ref byte rawData = ref this.GetRawData();
23 ref byte rawData2 = ref obj.GetRawData();
24 if (RuntimeHelpers.GetMethodTable(obj)->ContainsGCPointers)
25 {
26 Buffer.BulkMoveWithWriteBarrier(ref rawData2, ref rawData, rawObjectDataSize);
27 }
28 else
29 {
30 Buffer.Memmove(ref rawData2, ref rawData, rawObjectDataSize);
31 }
32 return obj;
33 }
34
35 [NonVersionable]
36 public Object()
37 {
38 }
39
40 [NonVersionable]
42 {
43 }
44
45 public virtual string? ToString()
46 {
47 return GetType().ToString();
48 }
49
50 public virtual bool Equals(object? obj)
51 {
52 return RuntimeHelpers.Equals(this, obj);
53 }
54
55 public static bool Equals(object? objA, object? objB)
56 {
57 if (objA == objB)
58 {
59 return true;
60 }
61 if (objA == null || objB == null)
62 {
63 return false;
64 }
65 return objA.Equals(objB);
66 }
67
68 [NonVersionable]
69 public static bool ReferenceEquals(object? objA, object? objB)
70 {
71 return objA == objB;
72 }
73
74 public virtual int GetHashCode()
75 {
76 return RuntimeHelpers.GetHashCode(this);
77 }
78}
static void BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount)
Definition Buffer.cs:31
static void Memmove(ref byte dest, ref byte src, nuint len)
Definition Buffer.cs:215
Type GetType()
unsafe object MemberwiseClone()
Definition Object.cs:18
virtual int GetHashCode()
Definition Object.cs:74
virtual ? string ToString()
Definition Object.cs:45
virtual bool Equals(object? obj)
Definition Object.cs:50
static bool ReferenceEquals(object? objA, object? objB)
Definition Object.cs:69
static bool Equals(object? objA, object? objB)
Definition Object.cs:55
static new bool Equals(object? o1, object? o2)
static unsafe nuint GetRawObjectDataSize(object obj)
static object AllocateUninitializedClone(object obj)
static unsafe MethodTable * GetMethodTable(object obj)
override string ToString()
Definition Type.cs:1108