ArrayCodePointGrid

Represents a grid of code points.

This grid internally uses a 2D array, where the first dimension represents the y coordinate (row) and the second dimension represents the x coordinate (column). This unconventional order is used intentionally to improve serialization performance from and to string lists.

Constructors

Link copied to clipboard
constructor(width: Int, height: Int)
constructor(grid: Array<IntArray>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var height: Int

The height of this grid, i.e. the number of rows.

Link copied to clipboard
open override var width: Int

The width of this grid, i.e. the number of columns.

Functions

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

Gets the code point at the specified x and y coordinates.

Link copied to clipboard
open override fun getCodePoints(): IntSet

Creates an IntSet of all code points in the grid, excluding 0 (null character).

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

Sets the code point at the specified x and y coordinates and resizes the grid if necessary.

Link copied to clipboard
open override fun toStringList(): List<String>

Creates a list of strings representing the rows of this grid.