Struct Int4
4D vector with intager data
Implements
Constructors
Int4(int, int, int, int)
4D vector with intager data
Declaration
public Int4(int x, int y, int z, int w)
Fields
One
Declaration
public static readonly Int4 One
Three
Declaration
public static readonly Int4 Three
Two
Declaration
public static readonly Int4 Two
Zero
Declaration
public static readonly Int4 Zero
w
Declaration
public int w
x
Declaration
public int x
y
Declaration
public int y
z
Declaration
public int z
Properties
IsZero
True if all values of this vector are 0
Declaration
public readonly bool IsZero { get; }
this[int]
Get int data inside with given index. (0 means x, 1 means y, 2 means z, 3 means w)
Declaration
public int this[int index] { readonly get; set; }
down
Treat this vector as padding/border value with 4 directions
Declaration
public int down { readonly get; set; }
horizontal
left + right
Declaration
public readonly int horizontal { get; }
left
Treat this vector as padding/border value with 4 directions
Declaration
public int left { readonly get; set; }
right
Treat this vector as padding/border value with 4 directions
Declaration
public int right { readonly get; set; }
up
Treat this vector as padding/border value with 4 directions
Declaration
public int up { readonly get; set; }
vertical
down + up
Declaration
public readonly int vertical { get; }
Methods
Contains(int)
True if any value inside this vector is given value
Declaration
public readonly bool Contains(int value)
Count(int)
How many value inside this vector is equal to given value
Declaration
public readonly int Count(int value)
Direction(int, int, int, int)
Get a Int4 as a padding/border with 4 directions
Declaration
public static Int4 Direction(int left, int right, int down, int up)
Equals(Int4)
Indicates whether the current object is equal to another object of the same type.
Declaration
public readonly bool Equals(Int4 other)
Parameters
Type | Name | Description |
---|---|---|
Int4 | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override readonly bool Equals(object other)
Returns
Type | Description |
---|---|
bool | true if |
Overrides
FindIndex(int)
Index of the given value from this vector
Declaration
public readonly int FindIndex(int value)
GetHashCode()
Returns the hash code for this instance.
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
Operators
operator +(Int4, Int4)
Declaration
public static Int4 operator +(Int4 a, Int4 b)
operator /(Int4, int)
Declaration
public static Int4 operator /(Int4 a, int b)
operator ==(Int4, Int4)
Declaration
public static bool operator ==(Int4 a, Int4 b)
explicit operator Int2(Int4)
Declaration
public static explicit operator Int2(Int4 i)
explicit operator Int3(Int4)
Declaration
public static explicit operator Int3(Int4 i)
operator !=(Int4, Int4)
Declaration
public static bool operator !=(Int4 a, Int4 b)
operator *(Int4, int)
Declaration
public static Int4 operator *(Int4 a, int b)
operator *(int, Int4)
Declaration
public static Int4 operator *(int b, Int4 a)