soc.client
Class SOCBoardPanel.BoardPanelSendBuildTask

java.lang.Object
  extended by java.util.TimerTask
      extended by soc.client.SOCBoardPanel.BoardPanelSendBuildTask
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
SOCBoardPanel

protected class SOCBoardPanel.BoardPanelSendBuildTask
extends java.util.TimerTask

Used for the delay between sending a build-request message, and receiving a game-state message. This timer will probably not be called, unless there's a large lag between the server and client. It's here just in case. Ideally the server responds right away, and the client responds to that.

Since:
1.1.00
See Also:
SOCHandPanel.autoRollSetupTimer()

Field Summary
protected  int buildLoc
           
protected  int pieceType
           
protected  boolean wasSentAlready
           
 
Constructor Summary
protected SOCBoardPanel.BoardPanelSendBuildTask(int coord, int ptype)
          Send this after maximum delay.
 
Method Summary
 void doNotSend()
           
 int getBuildLoc()
          Board coordinates, as used in SOCPutPiece message
 int getPieceType()
          Piece type, as used in SOCPlayingPiece / SOCPutPiece
 void run()
          This timer will probably not be called, unless there's a large lag between the server and client.
 void sendOnceFromClientIfCurrentPlayer()
          Internally synchronized around setSentAlready/wasItSentAlready.
 boolean wasItSentAlready()
           
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buildLoc

protected int buildLoc

pieceType

protected int pieceType

wasSentAlready

protected boolean wasSentAlready
Constructor Detail

SOCBoardPanel.BoardPanelSendBuildTask

protected SOCBoardPanel.BoardPanelSendBuildTask(int coord,
                                                int ptype)
Send this after maximum delay.

Parameters:
coord - Board coordinates, as used in SOCPutPiece message. Does not accept -1 for road edge 0x00.
ptype - Piece type, as used in SOCPlayingPiece / SOCPutPiece
Method Detail

getBuildLoc

public int getBuildLoc()
Board coordinates, as used in SOCPutPiece message


getPieceType

public int getPieceType()
Piece type, as used in SOCPlayingPiece / SOCPutPiece


run

public void run()
This timer will probably not be called, unless there's a large lag between the server and client. It's here just in case.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask

doNotSend

public void doNotSend()

wasItSentAlready

public boolean wasItSentAlready()

sendOnceFromClientIfCurrentPlayer

public void sendOnceFromClientIfCurrentPlayer()
Internally synchronized around setSentAlready/wasItSentAlready. Assumes player != null because of conditions leading to the call.