Enum Class GameStatsTarget

java.lang.Object
java.lang.Enum<GameStatsTarget>
net.royalur.stats.GameStatsTarget
All Implemented Interfaces:
Serializable, Comparable<GameStatsTarget>, Constable

public enum GameStatsTarget extends Enum<GameStatsTarget>
A target for the accumulation of statistics for games of the Royal Game of Ur.
  • Enum Constant Details

    • OVERALL

      public static final GameStatsTarget OVERALL
      The overall statistics of both players.
    • LIGHT

      public static final GameStatsTarget LIGHT
      The statistics of the light player.
    • DARK

      public static final GameStatsTarget DARK
      The statistics of the dark player.
  • Method Details

    • values

      public static GameStatsTarget[] 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 GameStatsTarget 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
    • getName

      public String getName()
      Gets a human-readable name representing this target, in English.
      Returns:
      A human-readable name representing this target, in English.
    • hasAssociatedPlayer

      public boolean hasAssociatedPlayer()
      Gets whether this target is associated with a specific player.
      Returns:
      Whether this target is associated with a specific player.
    • getAssociatedPlayer

      public PlayerType getAssociatedPlayer()
      Gets the specific player associated with this target.
      Returns:
      The specific player associated with this target.
      Throws:
      UnsupportedOperationException - if this target does not have an associated player.
    • get

      public static GameStatsTarget get(PlayerType player)
      Retrieves the target associated with player.
      Parameters:
      player - The player to retrieve the statistics for.
      Returns:
      The target associated with player.