Class Vector2Int
Integer vector with 2 elements. Represents a point in a 2D discrete space.
Inheritance
System.Object
Vector2Int
Assembly: Edgar.dll
Syntax
public sealed class Vector2Int : ValueType, IComparable<Vector2Int>, IEquatable<Vector2Int>
Constructors
Vector2Int(Int32, Int32)
Declaration
public Vector2Int(int x, int y)
Parameters
Type |
Name |
Description |
System.Int32 |
x |
|
System.Int32 |
y |
|
Fields
X
Declaration
Field Value
Type |
Description |
System.Int32 |
|
Y
Declaration
Field Value
Type |
Description |
System.Int32 |
|
Methods
CompareTo(Vector2Int)
Uses comparing operator to compare two vectors.
Declaration
public int CompareTo(Vector2Int other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DotProduct(Vector2Int)
Computes a dot product of two vectors.
Declaration
public int DotProduct(Vector2Int other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
ElementWiseProduct(Vector2Int)
Computes element-wise product of two vectors.
Declaration
public Vector2Int ElementWiseProduct(Vector2Int other)
Parameters
Returns
Equals(Vector2Int)
Check if two vectors are equal.
Declaration
public bool Equals(Vector2Int other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Check if two vectors are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
EuclideanDistance(Vector2Int, Vector2Int)
Compute an euclidean distance of two vectors.
Declaration
public static double EuclideanDistance(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Double |
|
GetAdjacentAndDiagonalVectors()
Gets all vectors that are adjacent and diagonal to this one.
That means vector that are different by 1 both of its components.
Declaration
public List<Vector2Int> GetAdjacentAndDiagonalVectors()
Returns
Type |
Description |
System.Collections.Generic.List<Vector2Int> |
|
GetAdjacentVectors()
Gets all vectors that are adjacent to this one.
That means vector that are different by 1 in exactly one of its components.
Declaration
public List<Vector2Int> GetAdjacentVectors()
Returns
Type |
Description |
System.Collections.Generic.List<Vector2Int> |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
ManhattanDistance(Vector2Int, Vector2Int)
Computes a manhattan distance of two vectors.
Declaration
public static int ManhattanDistance(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Int32 |
|
MaxDistance(Vector2Int, Vector2Int)
Computes a maximum distance between corresponding components of two vectors.
Declaration
public static int MaxDistance(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Int32 |
|
RotateAroundCenter(Int32)
Rotate the point around the center.
Declaration
public Vector2Int RotateAroundCenter(int degrees)
Parameters
Type |
Name |
Description |
System.Int32 |
degrees |
Multiples of 90 are expected.
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
ToStringShort()
Declaration
public string ToStringShort()
Returns
Type |
Description |
System.String |
|
Transforms a given vector.
Declaration
public Vector2Int Transform(TransformationGrid2D transformation)
Parameters
Returns
Operators
Addition(Vector2Int, Vector2Int)
Declaration
public static Vector2Int operator +(Vector2Int a, Vector2Int b)
Parameters
Returns
Equality(Vector2Int, Vector2Int)
Declaration
public static bool operator ==(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GreaterThan(Vector2Int, Vector2Int)
Declaration
public static bool operator>(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GreaterThanOrEqual(Vector2Int, Vector2Int)
Declaration
public static bool operator >=(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(Vector2Int, Vector2Int)
Declaration
public static bool operator !=(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
LessThan(Vector2Int, Vector2Int)
Declaration
public static bool operator <(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
LessThanOrEqual(Vector2Int, Vector2Int)
Declaration
public static bool operator <=(Vector2Int a, Vector2Int b)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Multiply(Int32, Vector2Int)
Declaration
public static Vector2Int operator *(int a, Vector2Int b)
Parameters
Returns
Subtraction(Vector2Int, Vector2Int)
Declaration
public static Vector2Int operator -(Vector2Int a, Vector2Int b)
Parameters
Returns
Implements
System.IComparable<>
System.IEquatable<>