MoveGeneratorHex

interface MoveGeneratorHex : MoveGenerator<BoardHex, MoveGeneratorHex, PieceHex, Coordinate2D>

Implementation of the Move Generator interface for a 2d square board.

Types

AddPromotion
Link copied to clipboard
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
CaptureOnly
Link copied to clipboard
data class CaptureOnly(moveGenerator: MoveGeneratorHex) : MoveGeneratorHex
A given move can only occur if it captures a piece
Composite
Link copied to clipboard
data class Composite(moveGenerators: List<MoveGeneratorHex>) : MoveGeneratorHex
A wrapper around a list of basic moves to represent composite moves
Leaper
Link copied to clipboard
data class Leaper(stepVectors: List<Coordinate2D>) : MoveGeneratorHex
Performs single steps to specified target squares Takes in a step-vector, which is then mirrored to give a total of up to 8 target coordinates
NoCapture
Link copied to clipboard
data class NoCapture(moveGenerator: MoveGeneratorHex) : MoveGeneratorHex
A given move can only occur if it does not capture a piece
Restricted
Link copied to clipboard
data class Restricted(moveGenerator: MoveGeneratorHex, region: Region2D) : MoveGeneratorHex
A given move can only occur when the piece starts in a specific region
RestrictedDestination
Link copied to clipboard
data class RestrictedDestination(moveGenerator: MoveGeneratorHex, region: Region2D) : MoveGeneratorHex
A given move can only occur if the destination is within a specific region
Slider
Link copied to clipboard
class Slider(directions: List<DirectionHex>) : MoveGeneratorHex
Moves along a ray direction until they encounter another piece or the edge of the board
Stepper
Link copied to clipboard
data class Stepper(directions: List<DirectionHex>, step: Int, canCapture: Boolean) : MoveGeneratorHex
Performs single (repeated) steps in a particular board direction

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
generate
Link copied to clipboard
abstract fun generate(board: BoardHex, coordinate: Coordinate2D, piece: PieceHex, player: Player): List<Move<BoardHex, MoveGeneratorHex, PieceHex, Coordinate2D>>
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

Inheritors

MoveGeneratorHex
Link copied to clipboard
MoveGeneratorHex
Link copied to clipboard
MoveGeneratorHex
Link copied to clipboard
MoveGeneratorHex
Link copied to clipboard
MoveGeneratorHex
Link copied to clipboard
MoveGeneratorHex
Link copied to clipboard
MoveGeneratorHex
Link copied to clipboard
MoveGeneratorHex
Link copied to clipboard
MoveGeneratorHex
Link copied to clipboard