PieceMobility

dicechess.engine.search.PieceMobility
object PieceMobility

Shared-core primitive computing per-piece-type pseudo-legal move counts for an explicit perspective color.

Moves are computed on state.withActiveColor(color) with castling dice present (King and Rook), exactly matching the move-generation operands of RichFeatures (mobility_diff). The move counts follow dice-value order: Pawn (1), Knight (2), Bishop (3), Rook (4), Queen (5), and King (6).

The sum over all six piece types equals the total pseudo-legal move count for color, preserving the invariant: sum(own_moves_*) - sum(opp_moves_*) == mobility_diff across every board position.

Attributes

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

Members list

Value members

Concrete methods

def count(state: GameState, color: Color, pieceType: PieceType): Int

Returns the pseudo-legal move count for a single piece type of color.

Returns the pseudo-legal move count for a single piece type of color.

Attributes

Source
PieceMobility.scala
def counts(state: GameState, color: Color): Array[Int]

Returns an array of the six per-piece-type pseudo-legal move counts for color in dice order: Pawn, Knight, Bishop, Rook, Queen, King.

Returns an array of the six per-piece-type pseudo-legal move counts for color in dice order: Pawn, Knight, Bishop, Rook, Queen, King.

Attributes

Source
PieceMobility.scala
def total(state: GameState, color: Color): Int

Returns the total pseudo-legal move count for color across all piece types.

Returns the total pseudo-legal move count for color across all piece types.

Attributes

Source
PieceMobility.scala