|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.moyoman.comm.client.Player
|
+--org.moyoman.comm.client.ValidatedPlayer
|
+--org.moyoman.comm.client.MoyomanPlayer
|
+--org.moyoman.client.reference.InteractiveComputerPlayer
Provides an implementation of ValidatedPlayer to allow both
mouse input and computer play. The two play modes are toggled by
setInteractive(boolean). Interactive as true indicates mouse
player mode; false indicates computer player mode.
| Field Summary | |
private boolean |
_isInteractive
Flag indicating whether this is in interactive mode. |
private MousePlayer |
_mousePlayer
Mouse player. |
| Fields inherited from class org.moyoman.comm.client.MoyomanPlayer |
|
| Fields inherited from class org.moyoman.comm.client.Player |
color, handicap |
| Constructor Summary | |
InteractiveComputerPlayer(IMoyoman owner,
Color color,
Handicap handicap,
Mode mode,
CommandExecutor commandExecutor,
boolean isInteractive)
Construct this object with the given parameters. |
|
| Method Summary | |
void |
derivedMakeMove(MoveDescriptor md)
Make a move. |
MoveDescriptor |
derivedRequestMove()
Get a move from the player. |
String |
getIdentifyingInfo()
Return identifying information about this player. |
void |
mouseClicked(MouseEvent event)
Respond to a mouse click. |
void |
mouseEntered(MouseEvent event)
Implement the mouse listener inteface. |
void |
mouseExited(MouseEvent event)
Implement the mouse listener inteface. |
void |
mousePressed(MouseEvent event)
Implement the mouse listener inteface. |
void |
mouseReleased(MouseEvent event)
Implement the mouse listener inteface. |
void |
setInteractive(boolean isInteractive)
Set the flag which indicates whether this is in interactive mode. |
| Methods inherited from class org.moyoman.comm.client.MoyomanPlayer |
getDebuggingInfo, getGameRecord, getId, getMoveNumber, getSuggestedMove, isSelfInitializingUser, listDebuggingModules, requestResignation, setProperties |
| Methods inherited from class org.moyoman.comm.client.ValidatedPlayer |
isValidatedUser |
| Methods inherited from class org.moyoman.comm.client.Player |
getColor, getHandicap, makeMove, makeMoveNoEvents, registerEndOfGameMoveListener, registerMakeMoveListener, registerRequestMoveListener, requestMove, unregisterEndOfGameListeners, unregisterMakeMoveListeners, unregisterRequestMoveListeners |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private MousePlayer _mousePlayer
private boolean _isInteractive
| Constructor Detail |
public InteractiveComputerPlayer(IMoyoman owner,
Color color,
Handicap handicap,
Mode mode,
CommandExecutor commandExecutor,
boolean isInteractive)
throws InternalErrorException
owner - The owner.color - The color of the player.handicap - The handicap of the game.mode - Computer player mode.commandExecutor - Command executor.isInteractive - Flag indicating whether this is in interactive mode
initially.
InternalErrorException - Thrown if the operation fails for any
reason.| Method Detail |
public String getIdentifyingInfo()
getIdentifyingInfo in class MoyomanPlayerpublic void setInteractive(boolean isInteractive)
public void derivedMakeMove(MoveDescriptor md)
throws IllegalMoveException,
InternalErrorException
derivedMakeMove in class MoyomanPlayermd - The MoveDescriptor which describes the move to make.
IllegalMoveException - Thrown if the move is illegal.
InternalErrorException - Thrown if the operation fails for any
reason.
public MoveDescriptor derivedRequestMove()
throws IllegalMoveException,
InternalErrorException
derivedRequestMove in class MoyomanPlayerIllegalMoveException - Thrown if the move is illegal.
InternalErrorException - Thrown if the operation fails for any
reason.public void mouseClicked(MouseEvent event)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent event)
mouseEntered in interface MouseListenerevent - A mouse event.public void mouseExited(MouseEvent event)
mouseExited in interface MouseListenerevent - A mouse event.public void mousePressed(MouseEvent event)
mousePressed in interface MouseListenerevent - A mouse event.public void mouseReleased(MouseEvent event)
mouseReleased in interface MouseListenerevent - A mouse event.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||