|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.engine.random.ScriptedRandomSource
public class ScriptedRandomSource
A random source for use while debugging.
Returns the random numbers designated in the system property triplea.scriptedRandom
for example, to roll 1,2,3 use -Dtriplea.scriptedRandom=1,2,3
When scripted random runs out of numbers, the numbers will repeat.
Special characters are also allowed in the sequence. e - the random source will throw an error p - the random source will pause and never return.
| Field Summary | |
|---|---|
static int |
ERROR
|
static int |
PAUSE
|
| Constructor Summary | |
|---|---|
ScriptedRandomSource()
Create a scripted random source from the system property triplea.scriptedRandom. |
|
ScriptedRandomSource(int[] numbers)
Create a scripted random from the given numbers. |
|
ScriptedRandomSource(java.lang.Integer... numbers)
|
|
| Method Summary | |
|---|---|
int[] |
getRandom(int max,
int count,
java.lang.String annotation)
|
int |
getRandom(int max,
java.lang.String annotation)
|
int |
getTotalRolled()
|
static boolean |
useScriptedRandom()
Should we use a scripted random sourcce. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PAUSE
public static final int ERROR
| Constructor Detail |
|---|
public ScriptedRandomSource()
public ScriptedRandomSource(int[] numbers)
public ScriptedRandomSource(java.lang.Integer... numbers)
| Method Detail |
|---|
public static boolean useScriptedRandom()
public int getRandom(int max,
java.lang.String annotation)
getRandom in interface IRandomSource
public int[] getRandom(int max,
int count,
java.lang.String annotation)
getRandom in interface IRandomSourcepublic int getTotalRolled()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||