Class Vec2i
- Namespace
- Vintagestory.API.MathTools
- Assembly
- VintagestoryAPI.dll
Represents a vector of 2 ints. Go bug Tyron if you need more utility methods in this class.
[ProtoContract]
public class Vec2i : IEquatable<Vec2i>
- Inheritance
-
Vec2i
- Implements
- Inherited Members
- Extension Methods
Constructors
Vec2i()
public Vec2i()
Vec2i(int, int)
public Vec2i(int x, int y)
Parameters
Vec2i(Vec3d)
public Vec2i(Vec3d pos)
Parameters
pos
Vec3d
Fields
X
[ProtoMember(1)]
public int X
Field Value
Y
[ProtoMember(2)]
public int Y
Field Value
Properties
this[int]
public int this[int index] { get; set; }
Parameters
index
int
Property Value
Zero
public static Vec2i Zero { get; }
Property Value
Methods
Add(int, int)
public Vec2i Add(int dx, int dy)
Parameters
Returns
Copy()
public Vec2i Copy()
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
Equals(Vec2i)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Vec2i other)
Parameters
other
Vec2iAn object to compare with this object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ManhattenDistance(int, int)
public int ManhattenDistance(int x, int y)
Parameters
Returns
ManhattenDistance(Vec2i)
public int ManhattenDistance(Vec2i point)
Parameters
point
Vec2i
Returns
Set(int, int)
public Vec2i Set(int x, int y)
Parameters
Returns
Set(Vec2i)
public Vec2i Set(Vec2i vec)
Parameters
vec
Vec2i
Returns
ToChunkIndex()
27 lowest bits for X Coordinate, then 27 bits for Z coordinate
public ulong ToChunkIndex()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator +(Vec2i, int)
public static Vec2i operator +(Vec2i left, int right)
Parameters
Returns
operator +(Vec2i, Vec2i)
public static Vec2i operator +(Vec2i left, Vec2i right)
Parameters
Returns
operator /(Vec2i, int)
public static Vec2i operator /(Vec2i left, int right)
Parameters
Returns
operator /(Vec2i, float)
public static Vec2i operator /(Vec2i left, float right)
Parameters
Returns
operator ==(Vec2i, Vec2i)
public static bool operator ==(Vec2i left, Vec2i right)
Parameters
Returns
operator !=(Vec2i, Vec2i)
public static bool operator !=(Vec2i left, Vec2i right)
Parameters
Returns
operator *(double, Vec2i)
public static Vec2i operator *(double left, Vec2i right)
Parameters
Returns
operator *(int, Vec2i)
public static Vec2i operator *(int left, Vec2i right)
Parameters
Returns
operator *(Vec2i, double)
public static Vec2i operator *(Vec2i left, double right)
Parameters
Returns
operator *(Vec2i, int)
public static Vec2i operator *(Vec2i left, int right)
Parameters
Returns
operator *(Vec2i, Vec2i)
public static double operator *(Vec2i left, Vec2i right)
Parameters
Returns
operator -(int, Vec2i)
public static Vec2i operator -(int left, Vec2i right)
Parameters
Returns
operator -(Vec2i, int)
public static Vec2i operator -(Vec2i left, int right)
Parameters
Returns
operator -(Vec2i, Vec2i)
public static Vec2i operator -(Vec2i left, Vec2i right)