Piece class abstract

Piece represents a game piece. It contains information of what type this piece is (e.g. pawn, knight, etc.) and what color it is.

Implementers

Constructors

Piece()
Const constructor for overrided members to be able to have const constructors.
const

Properties

color PieceColor
color of the piece.
no setter
fenSymbol String
Returns FEN symbol for this piece.
no setter
hashCode int
The hash code for this object.
no setteroverride
isBlack bool
Returns true if this piece is black.
no setter
isWhite bool
Returns true if this piece is white.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type PieceType
type of the piece, e.g. pawn, knight, etc.
no setter

Methods

getPossibleMovesFromSquareOnBoard(Square square, Board board) List<Move>
Returns the list of possible moves with this piece from square, including moves that are illegal in current position.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object? other) bool
The equality operator.
override

Static Methods

fromFenSymbol(String fenSymbol) Piece
Creates an appropriate piece for fenSymbol.