Tile

data class Tile(val x: Int, val y: Int, var data: Any? = null)

Represents a node in the Grid graph with x and y coordinates and optional data, which can be considered the node value

Constructors

Link copied to clipboard
constructor(x: Int, y: Int, data: Any? = null)

Properties

Link copied to clipboard
var data: Any?

Optional data associated with the tile, which can be considered a node of any type

Link copied to clipboard
val x: Int

The x-coordinate of the tile.

Link copied to clipboard
val y: Int

The y-coordinate of the tile.

Functions

Link copied to clipboard
fun dataIsDigit(): Boolean

Checks if the data property of the Tile is a Char and whether that Char represents a digit.

Link copied to clipboard
fun xPlusYTimesWidth(width: Int): Int