Vector3Int.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. public struct Vector3Int
  3. {
  4. public Vector3Int(int x, int y, int z)
  5. {
  6. this.m_x = x;
  7. this.m_y = y;
  8. this.m_z = z;
  9. }
  10. public int x
  11. {
  12. get
  13. {
  14. return this.m_x;
  15. }
  16. set
  17. {
  18. this.m_x = value;
  19. }
  20. }
  21. public int y
  22. {
  23. get
  24. {
  25. return this.m_y;
  26. }
  27. set
  28. {
  29. this.m_y = value;
  30. }
  31. }
  32. public int z
  33. {
  34. get
  35. {
  36. return this.m_z;
  37. }
  38. set
  39. {
  40. this.m_z = value;
  41. }
  42. }
  43. public void Set(int x, int y, int z)
  44. {
  45. this.m_x = x;
  46. this.m_y = y;
  47. this.m_z = z;
  48. }
  49. public override bool Equals(object obj)
  50. {
  51. Vector3Int vector3Int = (Vector3Int)obj;
  52. return this.x == vector3Int.x && this.y == vector3Int.y && this.z == vector3Int.z;
  53. }
  54. public static bool operator ==(Vector3Int a, Vector3Int b)
  55. {
  56. return a.Equals(b);
  57. }
  58. public static bool operator !=(Vector3Int a, Vector3Int b)
  59. {
  60. return !a.Equals(b);
  61. }
  62. public override int GetHashCode()
  63. {
  64. return 0;
  65. }
  66. public static Vector3Int zero
  67. {
  68. get
  69. {
  70. return new Vector3Int(0, 0, 0);
  71. }
  72. }
  73. private int m_x;
  74. private int m_y;
  75. private int m_z;
  76. }