AddPromotion

data class AddPromotion(moveGenerators: List<MoveGeneratorHex>, region: Region2D, promoPieces: List<PieceHex>, forced: Boolean) : MoveGeneratorHex

A piece can be promoted to another piece in a specific region

Constructors

AddPromotion
Link copied to clipboard
fun AddPromotion(move: MoveGeneratorHex, region: Region2D, promoPieces: List<PieceHex>, forced: Boolean)
AddPromotion
Link copied to clipboard
fun AddPromotion(moveGenerators: List<MoveGeneratorHex>, region: Region2D, promoPieces: List<PieceHex>, forced: Boolean)

Functions

component1
Link copied to clipboard
operator fun component1(): List<MoveGeneratorHex>
component2
Link copied to clipboard
operator fun component2(): Region2D
component3
Link copied to clipboard
operator fun component3(): List<PieceHex>
component4
Link copied to clipboard
operator fun component4(): Boolean
copy
Link copied to clipboard
fun copy(moveGenerators: List<MoveGeneratorHex>, region: Region2D, promoPieces: List<PieceHex>, forced: Boolean): MoveGeneratorHex.AddPromotion
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

forced
Link copied to clipboard
val forced: Boolean
true if the piece must be promoted to one of promoPieces
moveGenerators
Link copied to clipboard
val moveGenerators: List<MoveGeneratorHex>
promoPieces
Link copied to clipboard
val promoPieces: List<PieceHex>
a list of pieces that the piece can be promoted to
region
Link copied to clipboard
val region: Region2D
the region that the promotion can occur