InfiniteGridStackedLongArray2

class InfiniteGridStackedLongArray2(val grid: SizeInt = SizeInt(16, 16), var empty: Long = StackedLongArray2.EMPTY) : SparseChunkedStackedLongArray2

Constructors

Link copied to clipboard
constructor(grid: SizeInt = SizeInt(16, 16), empty: Long = StackedLongArray2.EMPTY)

Properties

Link copied to clipboard
Link copied to clipboard
open override var contentVersion: Int

Version of the data. Each change increments this.

Link copied to clipboard
open override var empty: Long

The empty value that will be returned if the specified cell it out of bounds, or empty

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val height: Int

height of the data available here, get and set methods use values in the range y=0 until height

Link copied to clipboard
Link copied to clipboard
open override var maxLevel: Int

The maximum level of layers available on the whole stack

Link copied to clipboard
var maxX: Int
Link copied to clipboard
var maxY: Int
Link copied to clipboard
var minX: Int
Link copied to clipboard
var minY: Int
Link copied to clipboard
open override val startX: Int

Annotation of where in startX this stack would be placed in a bigger container, not used for set or get methods

Link copied to clipboard
open override val startY: Int

Annotation of where in startY this stack would be placed in a bigger container, not used for set or get methods

Link copied to clipboard
open override val width: Int

width of the data available here, get and set methods use values in the range x=0 until width

Functions

Link copied to clipboard
Link copied to clipboard

Duplicates the contents of this IStackedLongArray2 keeping its contents data

Link copied to clipboard
open override fun eachPosition(block: (x: Int, y: Int) -> Unit)
Link copied to clipboard
Link copied to clipboard
open operator override fun get(x: Int, y: Int, level: Int): Long

Gets the value at x, y at level, startX and startY are NOT used here so 0,0 means the top-left element

Link copied to clipboard
Link copied to clipboard
open override fun getChunkAt(x: Int, y: Int, create: Boolean = false): IStackedLongArray2?

Gets the chunk at the specified position x, optionally createing it if it doesn't exist (when supported by the underlying implementation)

Link copied to clipboard
open fun getFirst(x: Int, y: Int): Long

Gets the first value of the stack in the cell x, y

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getLast(x: Int, y: Int): Long

Gets the last value of the stack in the cell x, y

Link copied to clipboard
Link copied to clipboard
open override fun getStackLevel(x: Int, y: Int): Int

Number of values available at this x, y

Link copied to clipboard
Link copied to clipboard
open fun inside(x: Int, y: Int, level: Int): Boolean

open override fun inside(x: Int, y: Int): Boolean

Checks if x and y are inside this array in the range x=0 until width and y=0 until height ignoring startX and startY

Link copied to clipboard
open fun pop(x: Int, y: Int): Long

Removes and returns the latest value on top of x, y

Link copied to clipboard
Link copied to clipboard
open fun push(x: Int, y: Int, value: Long)

Adds a new value on top of x, y

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun removeAll(x: Int, y: Int): Boolean

Removes all levels at x, y

Link copied to clipboard
Link copied to clipboard
open fun removeAt(x: Int, y: Int, level: Int): Boolean

Removes the last value at x, y in the specified level

Link copied to clipboard
Link copied to clipboard
open fun removeFirst(x: Int, y: Int): Boolean

Removes the first value at x, y

Link copied to clipboard
Link copied to clipboard
open fun removeLast(x: Int, y: Int): Boolean

Removes the last value at x, y

Link copied to clipboard
Link copied to clipboard
open operator override fun set(x: Int, y: Int, level: Int, value: Long)

Sets the value at x, y at level, startX and startY are NOT used here so 0,0 means the top-left element

Link copied to clipboard
fun IStackedLongArray2.set(p: PointInt, level: Int, value: Long)
Link copied to clipboard
open fun setFirst(x: Int, y: Int, value: Long)

Set the first value of a stack in the cell x, y

Link copied to clipboard

Number of values available at this x, y

Link copied to clipboard
open fun setToFrom(x0: Int, y0: Int, level0: Int, x1: Int, y1: Int, level1: Int)

Copies the value at y1level1 into y0level0. Equivalent to thisx0,y0,level0 = thisx1,y1,level1