StackedIntArray2

class StackedIntArray2(val width: Int, val height: Int, val empty: Int = -1, val startX: Int = 0, val startY: Int = 0) : IStackedIntArray2

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, empty: Int = -1, startX: Int = 0, startY: Int = 0)

Types

Link copied to clipboard
object Companion

Properties

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

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
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 val maxLevel: Int

The maximum level of layers available on the whole stack

Link copied to clipboard
open override val startX: Int = 0

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 = 0

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
open override fun clone(): StackedIntArray2

Duplicates the contents of this IStackedIntArray2 keeping its contents data

Link copied to clipboard
fun ensureLevel(level: Int)
Link copied to clipboard
open operator override fun get(x: Int, y: Int, level: Int): Int

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
open fun getFirst(x: Int, y: Int): Int

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

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

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

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
open 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 override fun push(x: Int, y: Int, value: Int)

Adds a new value on top of x, y

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

Removes the last value at x, y

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

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
open fun setFirst(x: Int, y: Int, value: Int)

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

Link copied to clipboard
fun setLayer(level: Int, data: IntArray2)