Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
VertexPositionColorTexture.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.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
18
19 [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
20 public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0), new VertexElement(12, VertexElementFormat.Color, VertexElementUsage.Color, 0), new VertexElement(16, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0))
21 {
22 Name = "VertexPositionColorTexture.VertexDeclaration"
23 };
24
25 VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration;
26
27 public VertexPositionColorTexture(Vector3 position, Color color, Vector2 textureCoordinate)
28 {
29 Position = position;
30 Color = color;
31 TextureCoordinate = textureCoordinate;
32 }
33
34 public override int GetHashCode()
35 {
36 return Helpers.SmartGetHashCode(this);
37 }
38
39 public override string ToString()
40 {
41 return string.Format(CultureInfo.CurrentCulture, "{{Position:{0} Color:{1} TextureCoordinate:{2}}}", new object[3] { Position, Color, TextureCoordinate });
42 }
43
45 {
46 if (left.Position == right.Position && left.Color == right.Color)
47 {
48 return left.TextureCoordinate == right.TextureCoordinate;
49 }
50 return false;
51 }
52
54 {
55 return !(left == right);
56 }
57
58 public override bool Equals(object obj)
59 {
60 if (obj == null)
61 {
62 return false;
63 }
64 if (obj.GetType() != GetType())
65 {
66 return false;
67 }
68 return this == (VertexPositionColorTexture)obj;
69 }
70}
static unsafe int SmartGetHashCode(object obj)
Definition Helpers.cs:43
static CultureInfo CurrentCulture
VertexPositionColorTexture(Vector3 position, Color color, Vector2 textureCoordinate)
static bool operator!=(VertexPositionColorTexture left, VertexPositionColorTexture right)
static bool operator==(VertexPositionColorTexture left, VertexPositionColorTexture right)