Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
VertexPositionColor.cs
Go to the documentation of this file.
1using System;
4
6
9{
10 [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
12
13 [SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
14 public Color Color;
15
16 [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
18 {
19 Name = "VertexPositionColor.VertexDeclaration"
20 };
21
22 VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration;
23
24 public VertexPositionColor(Vector3 position, Color color)
25 {
26 Position = position;
27 Color = color;
28 }
29
30 public override int GetHashCode()
31 {
32 return Helpers.SmartGetHashCode(this);
33 }
34
35 public override string ToString()
36 {
37 return string.Format(CultureInfo.CurrentCulture, "{{Position:{0} Color:{1}}}", new object[2] { Position, Color });
38 }
39
40 public static bool operator ==(VertexPositionColor left, VertexPositionColor right)
41 {
42 if (left.Color == right.Color)
43 {
44 return left.Position == right.Position;
45 }
46 return false;
47 }
48
49 public static bool operator !=(VertexPositionColor left, VertexPositionColor right)
50 {
51 return !(left == right);
52 }
53
54 public override bool Equals(object obj)
55 {
56 if (obj == null)
57 {
58 return false;
59 }
60 if (obj.GetType() != GetType())
61 {
62 return false;
63 }
64 return this == (VertexPositionColor)obj;
65 }
66}
static unsafe int SmartGetHashCode(object obj)
Definition Helpers.cs:43
static CultureInfo CurrentCulture
static bool operator!=(VertexPositionColor left, VertexPositionColor right)
static bool operator==(VertexPositionColor left, VertexPositionColor right)