Direction
enum
Inheritance
Implemented types
Mixed in types
Properties
area
→ int
Gets the area of a Rect whose corners are (0, 0) and this Vec.
no setter inherited
cardinalNeighbors
→ List <Vec >
The four Vecs surrounding this one to the north, south, east, and west.
no setter inherited
hashCode
→ int
The hash code for this object.
no setter inherited
index
→ int
A numeric identifier for the enumerated value.
no setter inherited
intercardinalNeighbors
→ List <Vec >
The four Vecs surrounding this one to the northeast, southeast, southwest,
and northwest.
no setter inherited
kingLength
→ int
Gets the king length of the Vec, which is the number of squares a king on
a chessboard would need to move from (0, 0) to reach the endpoint of the
Vec. Also known as Chebyshev distance.
no setter inherited
length
→ num
The Cartesian length of the vector.
no setter inherited
lengthSquared
→ int
no setter inherited
nearestDirection
→ Direction
The Direction that most closely approximates the angle of this Vec.
no setter inherited
neighbors
→ List <Vec >
The eight Vecs surrounding this one to the north, south, east, and west
and points in between.
no setter inherited
rookLength
→ int
Gets the rook length of the Vec, which is the number of squares a rook on
a chessboard would need to move from (0, 0) to reach the endpoint of the
Vec. Also known as Manhattan or taxicab distance.
no setter inherited
rotate180
→ Direction
no setter
rotateLeft45
→ Direction
no setter
rotateLeft90
→ Direction
no setter
rotateRight45
→ Direction
no setter
rotateRight90
→ Direction
no setter
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
x
→ int
final
y
→ int
final
Methods
abs ()
→ Vec
Returns a new Vec with the absolute value of the coordinates of this
one.
inherited
contains (Vec pos )
→ bool
Returns true
if pos
is within a rectangle from (0,0) to this vector
(half-inclusive).
inherited
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offset (int x , int y )
→ Vec
Returns a new Vec whose coordinates are this one's translated by x
and
y
.
inherited
offsetX (int x )
→ Vec
Returns a new Vec whose coordinates are this one's but with the X
coordinate translated by x
.
inherited
offsetY (int y )
→ Vec
Returns a new Vec whose coordinates are this one's but with the Y
coordinate translated by y
.
inherited
toString ()
→ String
A string representation of this object.
override
Constants
all
→ const List <Direction >
The eight cardinal and intercardinal directions.
cardinal
→ const List <Direction >
The four cardinal directions: north, south, east, and west.
intercardinal
→ const List <Direction >
The four directions between the cardinal ones: northwest, northeast,
southwest and southeast.
values
→ const List <Direction >
A constant List of the values in this enum, in order of their declaration.