GameState

dicechess.engine.domain.GameState
case class GameState(whitePieces: Bitboard, blackPieces: Bitboard, pawns: Bitboard, knights: Bitboard, bishops: Bitboard, rooks: Bitboard, queens: Bitboard, kings: Bitboard, mailbox: Map[Square, Piece], activeColor: Color, castlingRights: String, enPassant: Option[Square], halfMoveClock: Int, fullMoveNumber: Int)

The complete snapshot of a Dice Chess game state.

Uses a hybrid architecture combining fast Bitboards for move generation and a Map mailbox for constant-time piece lookups.

Value parameters

activeColor

The color of the player whose turn it is.

bishops

Bitboard for all Bishops (both colors).

blackPieces

Bitboard for all Black pieces.

castlingRights

FEN-standard castling string (e.g., "KQkq").

enPassant

Potential en passant target square.

fullMoveNumber

The number of the current full move.

halfMoveClock

Clock for the 50-move rule.

kings

Bitboard for all Kings (both colors).

knights

Bitboard for all Knights (both colors).

mailbox

Map of occupied squares to their respective pieces.

pawns

Bitboard for all Pawns (both colors).

queens

Bitboard for all Queens (both colors).

rooks

Bitboard for all Rooks (both colors).

whitePieces

Bitboard for all White pieces.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Extension method from dicechess.engine.domain

Applies a MicroMove (turn-based) to the current game state.

Applies a MicroMove (turn-based) to the current game state.

Handles piece movement, captures, and basic bitboard updates. This is a raw move application — higher-level logic such as switching turns after three micro-moves is the responsibility of the Turn manager.

The half-move clock is reset to 0 on pawn moves and captures; otherwise it is increased by 1.

Value parameters

mv

the micro-move to apply

Attributes

Returns

a new GameState reflecting the position after the move

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product