|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.util.Move
This class represents one move, which can be placing a stone, passing, or resigning.
Field Summary | |
private Color |
color
The color of the move. |
private short |
moveNumber
The move number. |
private NumberedStone |
nstone
The stone that was played as this move. |
static short |
PASS
The type corresponding to a pass. |
static short |
RESIGNATION
The type corresponding to a resignation. |
static short |
STONE_PLAYED
The type corresponding to a stone being played. |
private short |
type
The type of move. |
Constructor Summary | |
Move(NumberedStone stone)
Create a move object by placing a stone. |
|
Move(short tp,
short num,
Color c)
Create a move object which is either a pass, or a resignation. |
|
Move(short number,
Stone stone)
Create a move object by placing a stone. |
Method Summary | |
Object |
clone()
Clone the move object. |
Color |
getColor()
Get the color of the move. |
short |
getMoveNumber()
Get the move number. |
NumberedStone |
getNumberedStone()
Get the NumberedStone object. |
boolean |
isNumberedStone()
Return true if the move is a stone. |
boolean |
isPass()
Return true if the move is a pass. |
boolean |
isResignation()
Return true if the move is a resignation. |
String |
toString()
Get a string representing the move. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final short PASS
public static final short RESIGNATION
public static final short STONE_PLAYED
private NumberedStone nstone
private short type
private short moveNumber
private Color color
Constructor Detail |
public Move(NumberedStone stone)
stone
- - The numbered stone which is the move.public Move(short number, Stone stone)
number
- The move numberstone
- The stone which is the move.public Move(short tp, short num, Color c) throws IllegalArgumentException
IllegalArgumentException
- Thrown if type is not either PASS
or RESIGNATION.Method Detail |
public NumberedStone getNumberedStone() throws NoSuchDataException
NoSuchDataException
- Thrown if the move is not a stone being played.public boolean isPass()
public boolean isNumberedStone()
public boolean isResignation()
public short getMoveNumber()
public Color getColor()
public String toString()
toString
in class Object
public Object clone()
clone
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |