Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
VertexPositionTexture.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")]
15
16 [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
17 public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0), new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0))
18 {
19 Name = "VertexPositionTexture.VertexDeclaration"
20 };
21
22 VertexDeclaration IVertexType.VertexDeclaration => VertexDeclaration;
23
24 public VertexPositionTexture(Vector3 position, Vector2 textureCoordinate)
25 {
26 Position = position;
27 TextureCoordinate = textureCoordinate;
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} TextureCoordinate:{1}}}", new object[2] { Position, TextureCoordinate });
38 }
39
41 {
42 if (left.Position == right.Position)
43 {
44 return left.TextureCoordinate == right.TextureCoordinate;
45 }
46 return false;
47 }
48
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 == (VertexPositionTexture)obj;
65 }
66}
static unsafe int SmartGetHashCode(object obj)
Definition Helpers.cs:43
static CultureInfo CurrentCulture
VertexPositionTexture(Vector3 position, Vector2 textureCoordinate)
static bool operator!=(VertexPositionTexture left, VertexPositionTexture right)
static bool operator==(VertexPositionTexture left, VertexPositionTexture right)