ChessPawn

abstract class ChessPawn(player: Player, direction: Direction, startingRow: Int, promotionRegion: Region2D, pawnPromotions: List<Piece2D>) : Pawn, Piece2D

Represents a pawn in standard chess

Parameters

player

the player who owns the pawn

direction

the direction that the pawn is facing (determines the direction that pawn moves to)

startingRow

the row that the pawn starts from (used for double step move)

promotionRegion

the region that the promotion can occur

pawnPromotions

the pieces that the pawn can be promoted to

Constructors

ChessPawn
Link copied to clipboard
fun ChessPawn(player: Player, direction: Direction, startingRow: Int, promotionRegion: Region2D, pawnPromotions: List<Piece2D>)
the player who owns the pawn

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
getSymbol
Link copied to clipboard
open override fun getSymbol(): String
hashCode
Link copied to clipboard
open fun hashCode(): Int
toString
Link copied to clipboard
open fun toString(): String

Properties

moveGenerators
Link copied to clipboard
open override val moveGenerators: List<MoveGenerator2D>
that corresponds to the piece
player
Link copied to clipboard
open override val player: Player
the player who owns the pawn

Inheritors

BlackPawn
Link copied to clipboard
WhitePawn
Link copied to clipboard