Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AnchorData.cs
Go to the documentation of this file.
2
4
5public struct AnchorData
6{
8
9 public int tileCount;
10
11 public int checkStart;
12
13 public static AnchorData Empty;
14
15 public AnchorData(AnchorType type, int count, int start)
16 {
17 this.type = type;
18 tileCount = count;
19 checkStart = start;
20 }
21
22 public static bool operator ==(AnchorData data1, AnchorData data2)
23 {
24 if (data1.type == data2.type && data1.tileCount == data2.tileCount)
25 {
26 return data1.checkStart == data2.checkStart;
27 }
28 return false;
29 }
30
31 public static bool operator !=(AnchorData data1, AnchorData data2)
32 {
33 if (data1.type == data2.type && data1.tileCount == data2.tileCount)
34 {
35 return data1.checkStart != data2.checkStart;
36 }
37 return true;
38 }
39
40 public override bool Equals(object obj)
41 {
42 if (obj is AnchorData)
43 {
44 if (type == ((AnchorData)obj).type && tileCount == ((AnchorData)obj).tileCount)
45 {
46 return checkStart == ((AnchorData)obj).checkStart;
47 }
48 return false;
49 }
50 return false;
51 }
52
53 public override int GetHashCode()
54 {
55 byte b = (byte)checkStart;
56 byte b2 = (byte)tileCount;
57 return ((ushort)type << 16) | (b2 << 8) | b;
58 }
59}
override bool Equals(object obj)
Definition AnchorData.cs:40
static bool operator!=(AnchorData data1, AnchorData data2)
Definition AnchorData.cs:31
static bool operator==(AnchorData data1, AnchorData data2)
Definition AnchorData.cs:22
AnchorData(AnchorType type, int count, int start)
Definition AnchorData.cs:15