Package info.kwarc.kalah
Enum KalahState.GameResult
- java.lang.Object
-
- java.lang.Enum<KalahState.GameResult>
-
- info.kwarc.kalah.KalahState.GameResult
-
- All Implemented Interfaces:
Serializable,Comparable<KalahState.GameResult>
- Enclosing class:
- KalahState
public static enum KalahState.GameResult extends Enum<KalahState.GameResult>
Enum for possible game outcomes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DRAWAll houses are empty, both players have the same number of seeds in their stores.KNOWN_LOSSNot all houses are empty, but the other player has more than half of all seeds in their store, so it's known that the current player will lose.KNOWN_WINNot all houses are empty, but the current player has more than half of all seeds in their store, so it's known that the current player will win.LOSSAll houses are empty, the other player has more seeds in their store.UNDECIDEDThe outcome of the game is not determined by the seeds in the stores.WINAll houses are empty, the current player has more seeds in their store.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static KalahState.GameResultvalueOf(String name)Returns the enum constant of this type with the specified name.static KalahState.GameResult[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNDECIDED
public static final KalahState.GameResult UNDECIDED
The outcome of the game is not determined by the seeds in the stores.
-
LOSS
public static final KalahState.GameResult LOSS
All houses are empty, the other player has more seeds in their store.
-
DRAW
public static final KalahState.GameResult DRAW
All houses are empty, both players have the same number of seeds in their stores.
-
WIN
public static final KalahState.GameResult WIN
All houses are empty, the current player has more seeds in their store.
-
KNOWN_LOSS
public static final KalahState.GameResult KNOWN_LOSS
Not all houses are empty, but the other player has more than half of all seeds in their store, so it's known that the current player will lose.
-
KNOWN_WIN
public static final KalahState.GameResult KNOWN_WIN
Not all houses are empty, but the current player has more than half of all seeds in their store, so it's known that the current player will win.
-
-
Method Detail
-
values
public static KalahState.GameResult[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (KalahState.GameResult c : KalahState.GameResult.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static KalahState.GameResult valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
-