addNode

open override fun addNode(node: Tile)

Adds (or replaces) the tile at the node's (x, y) coordinates. Can also be used to restore a deleted tile.

NOTE: For performance, the coordinates are not validated. An x outside 0 until width, with a valid y, overwrites a tile on another row.

Parameters

node

The tile to add

Throws

If x + y * width is outside the grid (0 until width * height).