Enum Class Piece

java.lang.Object
java.lang.Enum<Piece>
be.belegkarnil.game.board.tak.Piece
All Implemented Interfaces:
Serializable, Comparable<Piece>, Constable

public enum Piece extends Enum<Piece>
TODO comments
Author:
Belegkarnil
  • Enum Constant Details

    • DOLMEN_BLACK

      public static final Piece DOLMEN_BLACK
      This piece is a dolmen associated to the black player (see Constants)
    • DOLMEN_WHITE

      public static final Piece DOLMEN_WHITE
      This piece is a dolmen associated to the white player (see Constants)
    • MENHIR_BLACK

      public static final Piece MENHIR_BLACK
      This piece is a menhir associated to the black player (see Constants)
    • MENHIR_WHITE

      public static final Piece MENHIR_WHITE
      This piece is a menhir associated to the white player (see Constants)
    • CAPSTONE_BLACK

      public static final Piece CAPSTONE_BLACK
      This piece is a capstone associated to the black player (see Constants)
    • CAPSTONE_WHITE

      public static final Piece CAPSTONE_WHITE
      This piece is a capstone associated to the white player (see Constants)
  • Field Details

    • color

      public final Color color
      The color of the piece which is either black or white (see Constants)
  • Method Details

    • values

      public static Piece[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Piece valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isWhite

      public boolean isWhite()
      Know if the current piece is associated to the WHITE (see Constants) Player
      Returns:
      true iff the piece is associated to the white player.
    • isBlack

      public boolean isBlack()
      Know if the current piece is associated to the BLACK (see Constants) Player
      Returns:
      true iff the piece is associated to the black player.
    • isMenhir

      public boolean isMenhir()
      Know if the current piece is a menhir
      Returns:
      true iff the piece is a menhir
    • isDolmen

      public boolean isDolmen()
      Know if the current piece is a dolmen
      Returns:
      true iff the piece is a dolmen
    • isCapstone

      public boolean isCapstone()
      Know if the current piece is a capstone
      Returns:
      true iff the piece is a capstone