Package-level declarations

Overview

Contains the board model and related primitives used to represent the game grid and pieces.

Notable types

  • Board — immutable board representation with safe transformation methods (add/change pieces, iterate pieces)

  • Coordinate — row/column pair with helper arithmetic and boundary checks

  • Piece — represents a single piece on the board with coordinate and piece type

  • PieceType — enum defining BLACK and WHITE pieces with associated symbols

Responsibilities

  • Coordinate and bounds validation

  • Legal move evaluation and piece flipping helpers (used by GameLogic)

  • Producing the initial board setup and iterating existing pieces

  • Providing immutable board transformations

Types

Link copied to clipboard
data class Board(val side: Int, val pieces: List<Piece> = emptyList()) : Iterable<Piece>

Represents a board game grid.

Link copied to clipboard
data class Coordinate(val row: Int, val col: Int)

Represents a coordinate on the board.

Link copied to clipboard
data class Piece(val coordinate: Coordinate, val value: PieceType, val isGhostPiece: Boolean = false)

Represents a piece on the board with its location and type.

Link copied to clipboard
enum PieceType(val symbol: Char) : Enum<PieceType>

Represents the type of piece on the board.