org.moyoman.comm.client
Class MoveValidator

java.lang.Object
  |
  +--org.moyoman.comm.client.MoveValidator

class MoveValidator
extends Object

This class validates moves for players which do not do so themselves.


Field Summary
private  CommandExecutor ce
          The CommandExecutor object.
private  String id
          The game id used for validation.
 
Constructor Summary
protected MoveValidator(Color c, Handicap h)
          Create the move validator object.
protected MoveValidator(String gid)
           
 
Method Summary
protected  GameRecord getGameRecord()
          Get the game record.
protected  String getId()
           
protected  Stone getLastMoveKo()
           
protected  short getMoveNumber()
          Get the move number.
protected  Stone[] getSuicideMoves()
           
protected  Stone[] getSuperKoMoves()
           
protected  MoveDescriptor makeMove(Move m)
          Make a move and check for legality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ce

private CommandExecutor ce
The CommandExecutor object.


id

private String id
The game id used for validation.

Constructor Detail

MoveValidator

protected MoveValidator(Color c,
                        Handicap h)
                 throws InternalErrorException
Create the move validator object.

Parameters:
h - The handicap of the game.
Throws:
InternalErrorException - - Thrown if the operation fails for any reason.

MoveValidator

protected MoveValidator(String gid)
                 throws InternalErrorException
Method Detail

getLastMoveKo

protected Stone getLastMoveKo()

getSuicideMoves

protected Stone[] getSuicideMoves()

getSuperKoMoves

protected Stone[] getSuperKoMoves()

makeMove

protected MoveDescriptor makeMove(Move m)
                           throws IllegalMoveException,
                                  InternalErrorException
Make a move and check for legality. Moves must be made for both players, not just the one for whom the move is being validated.

Parameters:
m - The move being entered.
Returns:
A MoveDescriptor object.
Throws:
IllegalMoveException - - Thrown if the move is illegal.
InternalErrorException - - Thrown if the operation fails for any reason.

getMoveNumber

protected short getMoveNumber()
                       throws InternalErrorException
Get the move number.

Returns:
A short which is the move number.
Throws:
InternalErrorException - Thrown if the operation fails for any reason.

getGameRecord

protected GameRecord getGameRecord()
                            throws InternalErrorException
Get the game record.

Returns:
A GameRecord object.
Throws:
InternalErrorException - - Thrown if the operation fails for any reason.

getId

protected String getId()