CoordGrid

value class CoordGrid(val packed: Int)

Coord grid, commonly referred to just as Coordinate or Location, is responsible for tracking absolute positions of avatars in the game.

Parameters

packed

the 30-bit bitpacked integer representing the coord grid.

Constructors

Link copied to clipboard
constructor(level: Int, x: Int, z: Int)
constructor(packed: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val level: Int
Link copied to clipboard
val packed: Int
Link copied to clipboard
val x: Int
Link copied to clipboard
val z: Int

Functions

Link copied to clipboard
operator fun component1(): Int
Link copied to clipboard
operator fun component2(): Int
Link copied to clipboard
operator fun component3(): Int
Link copied to clipboard
fun inDistance(other: CoordGrid, distance: Int): Boolean

Checks whether this coord grid is within distance of the other coord grid. If the coord grids are on different levels, this function will always return false.

Link copied to clipboard
inline fun invalid(): Boolean

Checks if this coord grid is uninitialized. Uninitialized coord grids are determined by checking if all 32 bits of the packed property are enabled (including sign bit, which would be the opposite). As the main constructor of this class only takes in the components that build a coord grid, it is impossible to make an instance of this that matches the invalid value, unless directly using the single-argument constructor.

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