BasePosition

abstract class BasePosition : Position

Base class for Position implementations.

Constructors

BasePosition
Link copied to clipboard
common
fun BasePosition()

Functions

compareTo
Link copied to clipboard
common
open operator override fun compareTo(other: Position): Int
component1
Link copied to clipboard
common
open operator fun component1(): Int
component2
Link copied to clipboard
common
open operator fun component2(): Int
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
minus
Link copied to clipboard
common
open operator override fun minus(other: Position): Position
Returns a new Position which is the difference of x and y both Positions.
plus
Link copied to clipboard
common
open operator override fun plus(other: Position): Position
Returns a new Position which is the sum of x and y in both Positions.
relativeToBottomOf
Link copied to clipboard
common
open override fun relativeToBottomOf(component: Component): Position
Creates a Position which is relative to the bottom of the given Component.
relativeToLeftOf
Link copied to clipboard
common
open override fun relativeToLeftOf(component: Component): Position
Creates a Position which is relative to the top left of the given Component.
relativeToRightOf
Link copied to clipboard
common
open override fun relativeToRightOf(component: Component): Position
Creates a Position which is relative to the right of the given Component.
relativeToTopOf
Link copied to clipboard
common
open override fun relativeToTopOf(component: Component): Position
Creates a Position which is relative to the top of the given Component.
to3DPosition
Link copied to clipboard
common
open fun to3DPosition(z: Int): Position3D
toPixelPosition
Link copied to clipboard
common
open override fun toPixelPosition(tileset: TilesetResource): PixelPosition
Turns this Position to a PixelPosition.
toPosition3D
Link copied to clipboard
common
open override fun toPosition3D(z: Int): Position3D
Creates a new Position3D from the x and y components of this Position and the given z value.
toSize
Link copied to clipboard
common
open override fun toSize(): Size
Transforms this Position to a Size so if this position is Position(x=2, y=3) it will become Size(x=2, y=3).
toString
Link copied to clipboard
common
open fun toString(): String
withRelative
Link copied to clipboard
common
open override fun withRelative(translate: Position): Position
Creates a new Position object that is translated by an amount of x and y specified by another Position.
withRelativeX
Link copied to clipboard
common
open override fun withRelativeX(delta: Int): Position
Creates a new Position object representing a position on the same y, but with a x offset by a supplied value.
withRelativeY
Link copied to clipboard
common
open override fun withRelativeY(delta: Int): Position
Creates a new Position object representing a position on the same x, but with a y offset by a supplied value.
withX
Link copied to clipboard
common
open override fun withX(x: Int): Position
Creates a new Position object representing a position with the same y index as this but with a supplied x index.
withY
Link copied to clipboard
common
open override fun withY(y: Int): Position
Creates a new Position object representing a position with the same y index as this but with a supplied y index.

Properties

hasNegativeComponent
Link copied to clipboard
common
open override val hasNegativeComponent: Boolean
Tells whether this Position has a negative component (x or y) or not.
isNotUnknown
Link copied to clipboard
common
open override val isNotUnknown: Boolean
Tells whether this Position is not UNKNOWN.
isUnknown
Link copied to clipboard
common
open override val isUnknown: Boolean
Tells whether this Position is UNKNOWN.
x
Link copied to clipboard
common
abstract val x: Int
y
Link copied to clipboard
common
abstract val y: Int

Inheritors

GridPosition
Link copied to clipboard
PixelPosition
Link copied to clipboard

Sources

(source)
Link copied to clipboard