Struct Direction
Represents a direction or neutral position
- Implements
Constructors
Direction(Vector2)
Creates a new direction from the given vector
Parameters
Fields
Down
Field Value
Left
Field Value
LeftDown
Field Value
LeftUp
Field Value
None
Field Value
Right
Field Value
RightDown
Field Value
RightUp
Field Value
Up
Field Value
Properties
IsNeutral
true
if the direction is in a neutral position. Same as checking against Direction.None
Property Value
Methods
Equals(Direction)
Indicates whether the current object is equal to another object of the same type.
Parameters
other
DirectionAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
FromTicks(int, int)
Creates a new direction from a ratio. with 0/1 corresponding to the direction (0,1), 1/4 corresponding to (1,0), etc.
Parameters
value
intThe amount of ticks clockwise from the Up direction (numerator)
maxValue
intThe number of ticks representing a full rotation (denominator)
Returns
- Direction
A direction with ratio
value
overmaxValue
GetHashCode()
Returns the hash code for this instance.
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
GetTicks(int)
Retrieves the amount of ticks clockwise from the Up direction
Parameters
maxValue
intThe number of ticks representing a full rotation
Returns
ToString()
Returns the fully qualified type name of this instance.
Returns
- string
The fully qualified type name.
Operators
operator ==(Direction, Direction)
Parameters
Returns
explicit operator Direction(Vector2)
Parameters
value
Vector2
Returns
explicit operator Vector2(Direction)
Parameters
value
Direction