java.lang.Object
java.lang.Enum<Card>
it.polimi.ingsw.server.model.game_logic.enums.Card
All Implemented Interfaces:
Serializable, Comparable<Card>, Constable

public enum Card extends Enum<Card> implements Comparable<Card>
This class represents each one of the 10 cards provided to each player at the start of a game.
  • Enum Constant Details

    • DOG

      public static final Card DOG
    • GOOSE

      public static final Card GOOSE
    • CAT

      public static final Card CAT
    • PARROT

      public static final Card PARROT
    • FOX

      public static final Card FOX
    • LIZARD

      public static final Card LIZARD
    • OCTOPUS

      public static final Card OCTOPUS
    • MASTIFF

      public static final Card MASTIFF
    • ELEPHANT

      public static final Card ELEPHANT
    • TURTLE

      public static final Card TURTLE
  • Field Details

    • value

      private final int value
    • steps

      private final int steps
  • Constructor Details

    • Card

      private Card(int value, int steps)
  • Method Details

    • values

      public static Card[] 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 Card 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
    • getValue

      public int getValue()
    • getSteps

      public int getSteps()
    • fromValue

      public static Optional<Card> fromValue(int value)