ShuffleRunnable

class ShuffleRunnable(handler: Handler, tilePosition: Int, numTiles: Int) : Runnable

Runnable class related to shuffling the puzzle tiles.

Parameters

handler

Allows sending and processing Message and Runnable objects associated with a thread's MessageQueue.

tilePosition

Position of the tile (zero-based, following row-major order).

numTiles

Number of tiles in the puzzle grid.

Constructors

ShuffleRunnable
Link copied to clipboard
fun ShuffleRunnable(handler: Handler, tilePosition: Int, numTiles: Int)
Creates a runnable class related to shuffling the puzzle tiles.

Types

Companion
Link copied to clipboard
object Companion
Companion object containing the atomic integer for tracking the progress related to shuffling the puzzle tiles.

Properties

handler
Link copied to clipboard
private val handler: Handler
Allows sending and processing Message and Runnable objects associated with a thread's MessageQueue.
numTiles
Link copied to clipboard
private val numTiles: Int
Number of tiles in the puzzle grid.
tilePosition
Link copied to clipboard
private val tilePosition: Int
Position of the tile (zero-based, following row-major order).

Functions

run
Link copied to clipboard
open override fun run()
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.