Hopper

data class Hopper(HV: Boolean, D: Boolean, canJumpOverSamePiece: Boolean) : MoveGenerator2D

Can move along a ray direction, but must jump over another piece

Constructors

Hopper
Link copied to clipboard
fun Hopper(HV: Boolean = false, D: Boolean = false, canJumpOverSamePiece: Boolean)

Functions

component1
Link copied to clipboard
operator fun component1(): Boolean
component2
Link copied to clipboard
operator fun component2(): Boolean
component3
Link copied to clipboard
operator fun component3(): Boolean
copy
Link copied to clipboard
fun copy(HV: Boolean = false, D: Boolean = false, canJumpOverSamePiece: Boolean): MoveGenerator2D.Hopper
equals
Link copied to clipboard
open operator override 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 override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String

Properties

canJumpOverSamePiece
Link copied to clipboard
val canJumpOverSamePiece: Boolean
true if it can jump over the same kind of piece
D
Link copied to clipboard
val D: Boolean = false
true if it can move along diagonal and anti-diagonal direction
HV
Link copied to clipboard
val HV: Boolean = false
true if it can move along horizontal and vertical direction