Piece class
Generic class for the pieces all the types of pieces implement this class.
We use this to be able to treat all the types as the same one with a common interface. It haves the following methods and fields:
- Userdata: Instance of the singleton to render custom skins.
- _img: String to save the img name.
- _value: Value of the Piece.
- isWhite: Boolean, it sets the color of the piece.
- isEmpty: Boolean method, it returns if a Piece is Empty or not(we use a Empty piece for all the empty squares).
- possibleMovements: Returns all the possible movements for the current board for a given piece.
Constructors
Properties
Methods
-
color(
) → bool -
getImg(
) → String -
getValue(
) → int -
isEmpty(
) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
possibleMovements(
int x, int y, List< List< board, bool reversedBoard, List<Piece> >List< lastMovement) → List<int> >List< int> > -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited