Class Figure

java.lang.Object
dev.laszlomocsy.tzaar.logic.figure.Figure

public class Figure extends Object
A single figure represented on the board.
  • 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

      public Figure(FigureLocation location, FigureColor color, FigureType type)
      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

      public Figure(FigureLocation location, FigureColor color, FigureType type, int height)
      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

      public FigureLocation getLocation()
      Gets the location of the figure on the board.
      Returns:
      The location of the figure.
    • setLocation

      public void setLocation(FigureLocation location)
      Sets the location of the figure on the board.
      Parameters:
      location - The new location of the figure.
    • getColor

      public FigureColor getColor()
      Gets the color of the figure.
      Returns:
      The color of the figure.
    • getType

      public FigureType getType()
      Gets the type of the figure.
      Returns:
      The type of the figure.
    • setType

      public void setType(FigureType type)
      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.