games.strategy.engine.random
Class PlainRandomSource

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

public class PlainRandomSource
extends java.lang.Object
implements IRandomSource

Gets random numbers from javas random number generators.


Constructor Summary
PlainRandomSource()
           
 
Method Summary
 int[] getRandom(int max, int count, java.lang.String annotation)
           
 int getRandom(int max, java.lang.String annotation)
           
static long getSeed()
          Knowing the seed gives a player an advantage.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainRandomSource

public PlainRandomSource()
Method Detail

getSeed

public static long getSeed()
Knowing the seed gives a player an advantage. Do something a little more clever than current time. which could potentially be guessed If the execution path is different before the first random call is made then the object will have a somewhat random adress in the virtual machine, especially if a lot of ui and networking objects are created in response to semi random mouse motion etc. if the excecution is always the same then this may vary depending on the vm


getRandom

public int[] getRandom(int max,
                       int count,
                       java.lang.String annotation)
Specified by:
getRandom in interface IRandomSource

getRandom

public int getRandom(int max,
                     java.lang.String annotation)
Specified by:
getRandom in interface IRandomSource

main

public static void main(java.lang.String[] args)