Package featurecat.lizzie.rules
Enum Stone
- java.lang.Object
-
- java.lang.Enum<Stone>
-
- featurecat.lizzie.rules.Stone
-
- All Implemented Interfaces:
Serializable
,Comparable<Stone>
public enum Stone extends Enum<Stone>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLACK
BLACK_CAPTURED
BLACK_GHOST
BLACK_POINT
BLACK_RECURSED
DAME
EMPTY
WHITE
WHITE_CAPTURED
WHITE_GHOST
WHITE_POINT
WHITE_RECURSED
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isBlack()
boolean
isWhite()
Stone
opposite()
used to find the opposite color stoneStone
recursed()
used to keep track of which stones were visited during removal of dead stonesStone
unGhosted()
Stone
unrecursed()
used to keep track of which stones were visited during removal of dead stonesstatic Stone
valueOf(String name)
Returns the enum constant of this type with the specified name.static Stone[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BLACK
public static final Stone BLACK
-
WHITE
public static final Stone WHITE
-
EMPTY
public static final Stone EMPTY
-
BLACK_RECURSED
public static final Stone BLACK_RECURSED
-
WHITE_RECURSED
public static final Stone WHITE_RECURSED
-
BLACK_GHOST
public static final Stone BLACK_GHOST
-
WHITE_GHOST
public static final Stone WHITE_GHOST
-
DAME
public static final Stone DAME
-
BLACK_POINT
public static final Stone BLACK_POINT
-
WHITE_POINT
public static final Stone WHITE_POINT
-
BLACK_CAPTURED
public static final Stone BLACK_CAPTURED
-
WHITE_CAPTURED
public static final Stone WHITE_CAPTURED
-
-
Method Detail
-
values
public static Stone[] 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 (Stone c : Stone.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Stone 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
-
opposite
public Stone opposite()
used to find the opposite color stone- Returns:
- the opposite stone type
-
recursed
public Stone recursed()
used to keep track of which stones were visited during removal of dead stones- Returns:
- the recursed version of this stone color
-
unrecursed
public Stone unrecursed()
used to keep track of which stones were visited during removal of dead stones- Returns:
- the unrecursed version of this stone color
-
isBlack
public boolean isBlack()
- Returns:
- Whether or not this stone is of the black variants.
-
isWhite
public boolean isWhite()
- Returns:
- Whether or not this stone is of the white variants.
-
unGhosted
public Stone unGhosted()
-
-