Slider

class Slider(H: Boolean, V: Boolean, D: Boolean, A: Boolean) : MoveGenerator2D

Moves along a ray direction until they encounter another piece or the edge of the board

Constructors

Slider
Link copied to clipboard
fun Slider(H: Boolean = false, V: Boolean = false, D: Boolean = false, A: Boolean = false)

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
generate
Link copied to clipboard
open override fun generate(board: Board2D, coordinate: Coordinate2D, piece: Piece2D, player: Player): List<BasicMove2D>
Takes in the current board, the piece to be moved and its coordinate, and the player who makes the move to return all possible game moves corresponding to the given type of movement.
hashCode
Link copied to clipboard
open fun hashCode(): Int
toString
Link copied to clipboard
open fun toString(): String

Properties

A
Link copied to clipboard
val A: Boolean = false
true if it can move along anti-diagonal direction
D
Link copied to clipboard
val D: Boolean = false
true if it can move along diagonal direction
H
Link copied to clipboard
val H: Boolean = false
true if it can move along horizontal direction
V
Link copied to clipboard
val V: Boolean = false
true if it can move along vertical direction