Stepper

data class Stepper(directions: List<DirectionHex>, step: Int, canCapture: Boolean) : MoveGeneratorHex

Performs single (repeated) steps in a particular board direction

Constructors

Stepper
Link copied to clipboard
fun Stepper(direction: DirectionHex, step: Int, canCapture: Boolean = false)
Stepper
Link copied to clipboard
fun Stepper(directions: List<DirectionHex>, step: Int, canCapture: Boolean = false)

Functions

component1
Link copied to clipboard
operator fun component1(): List<DirectionHex>
component2
Link copied to clipboard
operator fun component2(): Int
component3
Link copied to clipboard
operator fun component3(): Boolean
copy
Link copied to clipboard
fun copy(directions: List<DirectionHex>, step: Int, canCapture: Boolean = false): MoveGeneratorHex.Stepper
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
generate
Link copied to clipboard
open override fun generate(board: BoardHex, coordinate: Coordinate2D, piece: PieceHex, player: Player): List<BasicMoveHex>
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 override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String

Properties

canCapture
Link copied to clipboard
val canCapture: Boolean = false
true if it can capture an enemy piece
directions
Link copied to clipboard
val directions: List<DirectionHex>
a list of available directions
step
Link copied to clipboard
val step: Int
the number of steps