Move

dicechess.engine.domain.Move$package.Move
object Move

Companion object for Move: smart constructors, flag constants, and extension methods.

Flag constants follow the Chess Programming Wiki standard 4-bit encoding, extended with higher bits for promotions. The encoding allows O(1) flag tests using bitwise arithmetic.

Attributes

Source
Move.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Move.type

Members list

Value members

Concrete methods

def apply(from: Square, to: Square, flags: Int): Move

Constructs a new encoded Move from origin, destination, and flags.

Constructs a new encoded Move from origin, destination, and flags.

Attributes

Source
Move.scala
def apply(from: Square, to: Square): Move

Constructs a new quiet Move.

Constructs a new quiet Move.

Attributes

Source
Move.scala

Concrete fields

Attributes

Source
Move.scala
val BishopPromotion: Int

Attributes

Source
Move.scala
val Capture: Int

Attributes

Source
Move.scala
val DoublePawnPush: Int

Attributes

Source
Move.scala
val EnPassantCapture: Int

Attributes

Source
Move.scala
val KingCastle: Int

Attributes

Source
Move.scala

Promotion-capture flags — both Bit 3 and Bit 2 are set.

Promotion-capture flags — both Bit 3 and Bit 2 are set.

Attributes

Source
Move.scala
val KnightPromotion: Int

Promotion flags — Bit 3 is set to distinguish promotions from normal moves.

Promotion flags — Bit 3 is set to distinguish promotions from normal moves.

Attributes

Source
Move.scala
val QueenCastle: Int

Attributes

Source
Move.scala

Attributes

Source
Move.scala
val QueenPromotion: Int

Attributes

Source
Move.scala
val QuietMove: Int

Standard 4-bit move flags — quiet and special moves.

Standard 4-bit move flags — quiet and special moves.

Attributes

Source
Move.scala
val RookPromoCapture: Int

Attributes

Source
Move.scala
val RookPromotion: Int

Attributes

Source
Move.scala
val empty: Move

A sentinel move encoding a1→a1 with no flags. Used as a zero-value placeholder; never a legal move.

A sentinel move encoding a1→a1 with no flags. Used as a zero-value placeholder; never a legal move.

Attributes

Source
Move.scala

Extensions

Extensions

extension (move: Move)
def flags: Int

Returns the 4-bit flag of the move.

Returns the 4-bit flag of the move.

Attributes

Source
Move.scala

Returns the starting square of the move.

Returns the starting square of the move.

Attributes

Source
Move.scala
def isCapture: Boolean

Returns true if the move is any type of capture.

Returns true if the move is any type of capture.

Attributes

Source
Move.scala
def isCastling: Boolean

Returns true if the move is a castling move.

Returns true if the move is a castling move.

Attributes

Source
Move.scala
def isEnPassant: Boolean

Returns true if the move is an en passant capture.

Returns true if the move is an en passant capture.

Attributes

Source
Move.scala
def isPromotion: Boolean

Returns true if the move is any type of promotion.

Returns true if the move is any type of promotion.

Attributes

Source
Move.scala

Decodes promotion flags to the promoted dicechess.engine.domain.PieceType for API/serialization consumers.

Decodes promotion flags to the promoted dicechess.engine.domain.PieceType for API/serialization consumers.

Keep this mapping aligned with Position-level promotion decoding.

Attributes

Source
Move.scala
def toInt: Int

Returns the raw integer representation of the move.

Returns the raw integer representation of the move.

Attributes

Source
Move.scala

Returns the destination square of the move.

Returns the destination square of the move.

Attributes

Source
Move.scala
def toUci: String

Long algebraic (UCI) notation, e.g. "e2e4" or "e7e8q" for a queen promotion.

Long algebraic (UCI) notation, e.g. "e2e4" or "e7e8q" for a queen promotion.

Attributes

Source
Move.scala