rlgamekit.map.generators
Class Randomlib

java.lang.Object
  extended by rlgamekit.map.generators.Randomlib

public class Randomlib
extends java.lang.Object

Helper library for customized random calculations.


Constructor Summary
Randomlib()
           
 
Method Summary
static int linearRange(int low, int high)
          Returns an integer from the range [low, high]
static int oneOfWeightedList(int[] weights)
          Gets a random element out of a weighted list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Randomlib

public Randomlib()
Method Detail

linearRange

public static int linearRange(int low,
                              int high)
Returns an integer from the range [low, high]


oneOfWeightedList

public static int oneOfWeightedList(int[] weights)
Gets a random element out of a weighted list.

Returns:
index of chosen interval.