Coordinate2D

data class Coordinate2D(x: Int, y: Int) : Coordinate

Coordinate on a 2D board representing the x,y offset from the bottom left of the board

Constructors

Coordinate2D
Link copied to clipboard
fun Coordinate2D(x: Int, y: Int)

Functions

component1
Link copied to clipboard
operator fun component1(): Int
component2
Link copied to clipboard
operator fun component2(): Int
copy
Link copied to clipboard
fun copy(x: Int, y: Int): Coordinate2D
div
Link copied to clipboard
operator fun div(denom: Int): Coordinate2D
Returns the current coordinate divided by a given denominator, which is achieved by dividing (integer division) each component of the current coordinate by the given denominator
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
plus
Link copied to clipboard
operator fun plus(other: Coordinate2D): Coordinate2D
Returns the sum of the current coordinate and a given coordinate, which is achieved by element-wise addition
toString
Link copied to clipboard
open override fun toString(): String

Properties

x
Link copied to clipboard
val x: Int
the x offset from the bottom left of the board
y
Link copied to clipboard
val y: Int
the y offset from the bottom left of the board