Package threeChess
Class Piece
- java.lang.Object
-
- threeChess.Piece
-
public class Piece extends java.lang.Object
A specific piece on the board. Each piece has a Colour and a Type, and is immutable. Not an enum so we can have identical, but non-equal pieces, such as pawns.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Colour
getColour()
PieceType
getType()
int
getValue()
java.lang.String
toString()
-
-
-
Method Detail
-
getType
public PieceType getType()
- Returns:
- the type of the piece
-
getValue
public int getValue()
- Returns:
- the value of the piece
-
getColour
public Colour getColour()
- Returns:
- the colour of the piece
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a String representation of the piece
-
-