Class Figure
java.lang.Object
dev.laszlomocsy.tzaar.logic.figure.Figure
A single figure represented on the board.
-
Constructor Summary
ConstructorsConstructorDescriptionFigure()
Initializes a new figure with no location, color, type, and height.Figure
(FigureLocation location, FigureColor color, FigureType type) Initializes a new figure with the height of 1.Figure
(FigureLocation location, FigureColor color, FigureType type, int height) Initializes a new figure. -
Method Summary
Modifier and TypeMethodDescriptiongetColor()
Gets the color of the figure.int
Gets the height of the figure.Gets the location of the figure on the board.getType()
Gets the type of the figure.void
setHeight
(int height) Sets the height of the figure.void
setLocation
(FigureLocation location) Sets the location of the figure on the board.void
setType
(FigureType type) Sets the type of the figure.
-
Constructor Details
-
Figure
public Figure()Initializes a new figure with no location, color, type, and height.This constructor is used for creating a new figure with no properties. (Serialization)
-
Figure
Initializes a new figure with the height of 1.- Parameters:
location
- The location of the figure.color
- The color of the figure.type
- The type of the figure.
-
Figure
Initializes a new figure.- Parameters:
location
- The location of the figure.color
- The color of the figure.type
- The type of the figure.height
- The height of the figure.
-
-
Method Details
-
getLocation
Gets the location of the figure on the board.- Returns:
- The location of the figure.
-
setLocation
Sets the location of the figure on the board.- Parameters:
location
- The new location of the figure.
-
getColor
Gets the color of the figure.- Returns:
- The color of the figure.
-
getType
Gets the type of the figure.- Returns:
- The type of the figure.
-
setType
Sets the type of the figure.- Parameters:
type
- The new type of the figure.
-
getHeight
public int getHeight()Gets the height of the figure.- Returns:
- The height of the figure.
-
setHeight
public void setHeight(int height) Sets the height of the figure.- Parameters:
height
- The new height of the figure.
-