JSettlers v1.0.6 API
Built ${date}

soc.robot
Class SOCRobotClient

java.lang.Object
  extended bysoc.client.SOCDisplaylessPlayerClient
      extended bysoc.robot.SOCRobotClient
All Implemented Interfaces:
java.lang.Runnable

public class SOCRobotClient
extends SOCDisplaylessPlayerClient

This is a client that can play Settlers of Catan.

Author:
Robert S Thomas

Field Summary
protected  int cleanBrainKills
          number of clean brain kills
static java.lang.String CURRENT_PLANS
          constants for debug recording
static java.lang.String CURRENT_RESOURCES
           
protected  int gamesFinished
          number of games finished
protected  int gamesPlayed
          number of games this bot has played
protected  int gamesWon
          number of games this bot has won
protected  long startTime
          start time
 
Fields inherited from class soc.client.SOCDisplaylessPlayerClient
channels, connected, doc, ex, games, gotPassword, host, in, lastMessage, nickname, out, password, port, s, STATSPREFEX
 
Constructor Summary
SOCRobotClient(java.lang.String h, int p, java.lang.String nn, java.lang.String pw)
          Constructor for connecting to the specified host, on the specified port
 
Method Summary
 void addCleanKill()
          add one the the number of clean brain kills
 void destroy()
          destroy the applet
 void disconnectReconnect()
          disconnect and then try to reconnect
protected  void handleACCEPTOFFER(SOCAcceptOffer mes)
          handle the "accept offer" message
protected  void handleADMINPING(SOCAdminPing mes)
          handle the admin ping message
protected  void handleADMINRESET(SOCAdminReset mes)
          handle the admin reset message
protected  void handleBOARDLAYOUT(SOCBoardLayout mes)
          handle the "board layout" message
protected  void handleCHANGEFACE(SOCChangeFace mes)
          handle the "change face" message
protected  void handleCHOOSEPLAYERREQUEST(SOCChoosePlayerRequest mes)
          handle the "choose player request" message
protected  void handleCLEAROFFER(SOCClearOffer mes)
          handle the "clear offer" message
protected  void handleCLEARTRADEMSG(SOCClearTradeMsg mes)
          handle the "clear trade" message
protected  void handleDELETEGAME(SOCDeleteGame mes)
          handle the "delete game" message
protected  void handleDEVCARD(SOCDevCard mes)
          handle the "development card action" message
protected  void handleDEVCARDCOUNT(SOCDevCardCount mes)
          handle the "development card count" message
protected  void handleDICERESULT(SOCDiceResult mes)
          handle the "dice result" message
protected  void handleDISCARDREQUEST(SOCDiscardRequest mes)
          handle the "discard request" message
protected  void handleFIRSTPLAYER(SOCFirstPlayer mes)
          handle the "set first player" message
protected  void handleGAMEMEMBERS(SOCGameMembers mes)
          handle the "game members" message
protected  void handleGAMESTATE(SOCGameState mes)
          handle the "game state" message
protected  void handleGAMETEXTMSG(SOCGameTextMsg mes)
          handle the "game text message" message
protected  void handleJOINGAME(SOCJoinGame mes)
          handle the "join game" message
protected  void handleJOINGAMEAUTH(SOCJoinGameAuth mes)
          handle the "join game authorization" message
protected  void handleJOINGAMEREQUEST(SOCJoinGameRequest mes)
          handle the "join game request" message
protected  void handleLARGESTARMY(SOCLargestArmy mes)
          handle the "largest army" message
protected  void handleLEAVEGAME(SOCLeaveGame mes)
          handle the "leave game" message
protected  void handleLONGESTROAD(SOCLongestRoad mes)
          handle the "longest road" message
protected  void handleMAKEOFFER(SOCMakeOffer mes)
          handle the "make offer" message
protected  void handleMOVEROBBER(SOCMoveRobber mes)
          handle the "move robber" message
protected  void handlePLAYERELEMENT(SOCPlayerElement mes)
          handle the "player element" message
protected  void handlePOTENTIALSETTLEMENTS(SOCPotentialSettlements mes)
          handle the "potential settlements" message
protected  void handlePUTPIECE(SOCPutPiece mes)
          handle the "put piece" message
protected  void handleREJECTOFFER(SOCRejectOffer mes)
          handle the "reject offer" message
protected  void handleRESOURCECOUNT(SOCResourceCount mes)
          handle "resource count" message
protected  void handleROBOTDISMISS(SOCRobotDismiss mes)
          handle the "dismiss robot" message
protected  void handleSERVERPING(SOCServerPing mes)
          handle the server ping message
protected  void handleSETPLAYEDDEVCARD(SOCSetPlayedDevCard mes)
          handle the "set played development card" message
protected  void handleSETTURN(SOCSetTurn mes)
          handle the "set turn" message
protected  void handleSITDOWN(SOCSitDown mes)
          handle the "someone is sitting down" message
protected  void handleSTARTGAME(SOCStartGame mes)
          handle the "start game" message
protected  void handleTURN(SOCTurn mes)
          handle the "turn" message
protected  void handleUPDATEROBOTPARAMS(SOCUpdateRobotParams mes)
          handle the update robot params message
 void init()
          Initialize the robot player
 void leaveGame(SOCGame ga)
          the user leaves the given game
static void main(java.lang.String[] args)
          for stand-alones
 void treat(SOCMessage mes)
          Treat the incoming messages
 
Methods inherited from class soc.client.SOCDisplaylessPlayerClient
acceptOffer, bankTrade, buildRequest, buyDevCard, cancelBuildRequest, changeFace, choosePlayer, chSend, clearOffer, discard, disconnect, discoveryPick, endTurn, getNickname, handleBCASTTEXTMSG, handleCHANNELS, handleDELETECHANNEL, handleGAMES, handleGAMESTATS, handleJOIN, handleJOINAUTH, handleLEAVE, handleMEMBERS, handleNEWCHANNEL, handleNEWGAME, handleREJECTCONNECTION, handleSETSEATLOCK, handleSTATUSMESSAGE, handleTEXTMSG, leaveChannel, lockSeat, monopolyPick, moveRobber, offerTrade, playDevCard, put, putPiece, rejectOffer, resend, rollDice, run, sendText, sitDown, startGame, unlockSeat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CURRENT_PLANS

public static final java.lang.String CURRENT_PLANS
constants for debug recording

See Also:
Constant Field Values

CURRENT_RESOURCES

public static final java.lang.String CURRENT_RESOURCES
See Also:
Constant Field Values

gamesPlayed

protected int gamesPlayed
number of games this bot has played


gamesFinished

protected int gamesFinished
number of games finished


gamesWon

protected int gamesWon
number of games this bot has won


cleanBrainKills

protected int cleanBrainKills
number of clean brain kills


startTime

protected long startTime
start time

Constructor Detail

SOCRobotClient

public SOCRobotClient(java.lang.String h,
                      int p,
                      java.lang.String nn,
                      java.lang.String pw)
Constructor for connecting to the specified host, on the specified port

Parameters:
h - host
p - port
nn - nickname for robot
pw - password for robot
Method Detail

init

public void init()
Initialize the robot player


disconnectReconnect

public void disconnectReconnect()
disconnect and then try to reconnect


treat

public void treat(SOCMessage mes)
Treat the incoming messages

Overrides:
treat in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleSERVERPING

protected void handleSERVERPING(SOCServerPing mes)
handle the server ping message

Parameters:
mes - the message

handleADMINPING

protected void handleADMINPING(SOCAdminPing mes)
handle the admin ping message

Parameters:
mes - the message

handleADMINRESET

protected void handleADMINRESET(SOCAdminReset mes)
handle the admin reset message

Parameters:
mes - the message

handleUPDATEROBOTPARAMS

protected void handleUPDATEROBOTPARAMS(SOCUpdateRobotParams mes)
handle the update robot params message

Parameters:
mes - the message

handleJOINGAMEREQUEST

protected void handleJOINGAMEREQUEST(SOCJoinGameRequest mes)
handle the "join game request" message

Parameters:
mes - the message

handleJOINGAMEAUTH

protected void handleJOINGAMEAUTH(SOCJoinGameAuth mes)
handle the "join game authorization" message

Overrides:
handleJOINGAMEAUTH in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleJOINGAME

protected void handleJOINGAME(SOCJoinGame mes)
handle the "join game" message

Overrides:
handleJOINGAME in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleLEAVEGAME

protected void handleLEAVEGAME(SOCLeaveGame mes)
handle the "leave game" message

Overrides:
handleLEAVEGAME in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleGAMEMEMBERS

protected void handleGAMEMEMBERS(SOCGameMembers mes)
handle the "game members" message

Overrides:
handleGAMEMEMBERS in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleGAMETEXTMSG

protected void handleGAMETEXTMSG(SOCGameTextMsg mes)
handle the "game text message" message

Overrides:
handleGAMETEXTMSG in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleSITDOWN

protected void handleSITDOWN(SOCSitDown mes)
handle the "someone is sitting down" message

Overrides:
handleSITDOWN in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleBOARDLAYOUT

protected void handleBOARDLAYOUT(SOCBoardLayout mes)
handle the "board layout" message

Overrides:
handleBOARDLAYOUT in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleSTARTGAME

protected void handleSTARTGAME(SOCStartGame mes)
handle the "start game" message

Overrides:
handleSTARTGAME in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleDELETEGAME

protected void handleDELETEGAME(SOCDeleteGame mes)
handle the "delete game" message

Overrides:
handleDELETEGAME in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleGAMESTATE

protected void handleGAMESTATE(SOCGameState mes)
handle the "game state" message

Overrides:
handleGAMESTATE in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleSETTURN

protected void handleSETTURN(SOCSetTurn mes)
handle the "set turn" message

Overrides:
handleSETTURN in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleFIRSTPLAYER

protected void handleFIRSTPLAYER(SOCFirstPlayer mes)
handle the "set first player" message

Overrides:
handleFIRSTPLAYER in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleTURN

protected void handleTURN(SOCTurn mes)
handle the "turn" message

Overrides:
handleTURN in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handlePLAYERELEMENT

protected void handlePLAYERELEMENT(SOCPlayerElement mes)
handle the "player element" message

Overrides:
handlePLAYERELEMENT in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleRESOURCECOUNT

protected void handleRESOURCECOUNT(SOCResourceCount mes)
handle "resource count" message

Overrides:
handleRESOURCECOUNT in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleDICERESULT

protected void handleDICERESULT(SOCDiceResult mes)
handle the "dice result" message

Overrides:
handleDICERESULT in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handlePUTPIECE

protected void handlePUTPIECE(SOCPutPiece mes)
handle the "put piece" message

Overrides:
handlePUTPIECE in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleMOVEROBBER

protected void handleMOVEROBBER(SOCMoveRobber mes)
handle the "move robber" message

Overrides:
handleMOVEROBBER in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleDISCARDREQUEST

protected void handleDISCARDREQUEST(SOCDiscardRequest mes)
handle the "discard request" message

Overrides:
handleDISCARDREQUEST in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleCHOOSEPLAYERREQUEST

protected void handleCHOOSEPLAYERREQUEST(SOCChoosePlayerRequest mes)
handle the "choose player request" message

Overrides:
handleCHOOSEPLAYERREQUEST in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleMAKEOFFER

protected void handleMAKEOFFER(SOCMakeOffer mes)
handle the "make offer" message

Overrides:
handleMAKEOFFER in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleCLEAROFFER

protected void handleCLEAROFFER(SOCClearOffer mes)
handle the "clear offer" message

Overrides:
handleCLEAROFFER in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleREJECTOFFER

protected void handleREJECTOFFER(SOCRejectOffer mes)
handle the "reject offer" message

Overrides:
handleREJECTOFFER in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleACCEPTOFFER

protected void handleACCEPTOFFER(SOCAcceptOffer mes)
handle the "accept offer" message

Parameters:
mes - the message

handleCLEARTRADEMSG

protected void handleCLEARTRADEMSG(SOCClearTradeMsg mes)
handle the "clear trade" message

Overrides:
handleCLEARTRADEMSG in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleDEVCARDCOUNT

protected void handleDEVCARDCOUNT(SOCDevCardCount mes)
handle the "development card count" message

Overrides:
handleDEVCARDCOUNT in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleDEVCARD

protected void handleDEVCARD(SOCDevCard mes)
handle the "development card action" message

Overrides:
handleDEVCARD in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleSETPLAYEDDEVCARD

protected void handleSETPLAYEDDEVCARD(SOCSetPlayedDevCard mes)
handle the "set played development card" message

Overrides:
handleSETPLAYEDDEVCARD in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleROBOTDISMISS

protected void handleROBOTDISMISS(SOCRobotDismiss mes)
handle the "dismiss robot" message

Parameters:
mes - the message

handlePOTENTIALSETTLEMENTS

protected void handlePOTENTIALSETTLEMENTS(SOCPotentialSettlements mes)
handle the "potential settlements" message

Overrides:
handlePOTENTIALSETTLEMENTS in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleCHANGEFACE

protected void handleCHANGEFACE(SOCChangeFace mes)
handle the "change face" message

Overrides:
handleCHANGEFACE in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleLONGESTROAD

protected void handleLONGESTROAD(SOCLongestRoad mes)
handle the "longest road" message

Overrides:
handleLONGESTROAD in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

handleLARGESTARMY

protected void handleLARGESTARMY(SOCLargestArmy mes)
handle the "largest army" message

Overrides:
handleLARGESTARMY in class SOCDisplaylessPlayerClient
Parameters:
mes - the message

leaveGame

public void leaveGame(SOCGame ga)
the user leaves the given game

Overrides:
leaveGame in class SOCDisplaylessPlayerClient
Parameters:
ga - the game

addCleanKill

public void addCleanKill()
add one the the number of clean brain kills


destroy

public void destroy()
destroy the applet

Overrides:
destroy in class SOCDisplaylessPlayerClient

main

public static void main(java.lang.String[] args)
for stand-alones


JSettlers v1.0.6 API
Built ${date}