games.strategy.engine.random
Class PBEMDiceRoller

java.lang.Object
  extended by games.strategy.engine.random.PBEMDiceRoller
All Implemented Interfaces:
IRandomSource

public class PBEMDiceRoller
extends java.lang.Object
implements IRandomSource

Rolls the dice using http://www.irony.com/mailroll.html Its a bit messy, but the threads are a pain to deal with We want to be able to call this from any thread, and have a dialog that doesnt close until the dice roll finishes. If there is an error we wait until we get a good roll before returning.


Constructor Summary
PBEMDiceRoller(java.lang.String player1Email, java.lang.String player2Email, java.lang.String gameID, IRemoteDiceServer diceServer, java.lang.String gameUUID)
           
 
Method Summary
 int[] getRandom(int max, int count, java.lang.String annotation)
          getRandom
 int getRandom(int max, java.lang.String annotation)
          getRandom
static void setFocusWindow(java.awt.Frame w)
           
 void test()
          Do a test roll, leaving the dialog open after the roll is done.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PBEMDiceRoller

public PBEMDiceRoller(java.lang.String player1Email,
                      java.lang.String player2Email,
                      java.lang.String gameID,
                      IRemoteDiceServer diceServer,
                      java.lang.String gameUUID)
Method Detail

setFocusWindow

public static void setFocusWindow(java.awt.Frame w)

test

public void test()
Do a test roll, leaving the dialog open after the roll is done.


getRandom

public int[] getRandom(int max,
                       int count,
                       java.lang.String annotation)
getRandom

Specified by:
getRandom in interface IRandomSource

getRandom

public int getRandom(int max,
                     java.lang.String annotation)
getRandom

Specified by:
getRandom in interface IRandomSource
Parameters:
max - int
annotation - String
Returns:
int