Coordinate

value class Coordinate(packed: Int)

In many cases it is easier to work with a single coordinate rather than with a pair of coordinates. The coordinate class allows this.

Constructors

Link copied to clipboard
constructor(x: Short, y: Short)

The coordinates actually only store shorts

constructor(x: Int, y: Int)

Helper constructor to create a coordinate.

constructor(packed: Int)

Properties

Link copied to clipboard
val x: Int

The x part of the coordinate

Link copied to clipboard
val y: Int

The y part of the coordinate

Functions

Link copied to clipboard
operator fun component1(): Int

Decomposition operator for x coordinate

Link copied to clipboard
operator fun component2(): Int

Decomposition operator for y coordinate

Link copied to clipboard
open override fun toString(): String