Direction2D

enum Direction2D : Enum<Direction2D>

Cardinal and intercardinal directions indicating a movement.

Parameters

x

the X-value. Grows positively towards the "right".

y

the Y-value. Grows positively upwards.

Entries

Link copied to clipboard
NORTHWEST(-1, 1)
Link copied to clipboard
SOUTHWEST(-1, -1)
Link copied to clipboard
SOUTHEAST(1, -1)
Link copied to clipboard
NORTHEAST(1, 1)
Link copied to clipboard
WEST(-1, 0)
Link copied to clipboard
EAST(1, 0)
Link copied to clipboard
SOUTH(0, -1)
Link copied to clipboard
NORTH(0, 1)
Link copied to clipboard
NONE(0, 0)

Functions

Link copied to clipboard
operator fun contains(other: Direction2D): Boolean

Returns whether this direction contains other. Specifically, a direction "D" contains another if D Direction2D.plus equals D. For example, NORTHEAST contains NORTH and EAST, but not WEST. All directions contain NONE. NONE contains only NONE.

Link copied to clipboard
operator fun minus(other: Direction2D): Direction2D

Subtracts with a direction.

Link copied to clipboard
operator fun plus(other: Direction2D): Direction2D

Sums with a direction.

Link copied to clipboard
operator fun times(scalar: Int): Point

Multiplies by a scalar.

Properties

Link copied to clipboard
val flipped: Direction2D

Flips the direction horizontally and vertically.

Link copied to clipboard
val flippedX: Direction2D

Flips the direction's X-values.

Link copied to clipboard
val flippedY: Direction2D

Flips the direction's Y-values.

Link copied to clipboard
val name: String
Link copied to clipboard
val ordinal: Int
Link copied to clipboard
val x: Int
Link copied to clipboard
val y: Int