Major Revision
update v2.0
=-=-=-=-=
Native functions(exported to lua):
-GenerateEngine: returns engine id (args: seed)
-DestroyEngine: destroys corresponding engine (args: rngID)
-NewSeed re-seeds engine (args: rngID, seed)
-rollInt generates random integer (args: rngID, min, max)
-rollDouble generates random double (args: rngID, min, max)
-rollNormal generates random normal[gaus.] (args: rngID, avg, stddev)
-rollBool generates random boolean (args: rngID, chance)
-MakeNumSequence returns sequence id (args: start, end)
-AddToSequence adds a number to the sequence (args: seqID, num)
-ShuffleSequence shuffles the number sequence (args: rngID, seqID)
-NextInSequence returns the next number in seq.(args: seqID)
Lua plugin functions:
-MakeNewEngine returns engine id (args: seed)
Lua plugin classes:
-crng
methods:
-init(id, df, dist) :: constructor
id - Reference ID of engine to use in RNGenerations
df (optional) - bool indicating whether to destroy the Engine when the crng object is garbage collected
dist (optional) - lua number distribution to use
-__gc() :: destructor
-changeSeed(seed) :: alters engine's seed value
-setNumDistrib(distrib) :: set's the number distribution crng object should use
distrib - number distribution object to use in RNGenerations
-next() :: returns the next number in the distribution
-shuffle() :: effectively shuffles the number distribution
-normal_distribution
methods:
-init(avg, stddev) :: constructor
-next(id) :: returns next number in the distribution
id - engine ID to pass to native function
-real_distribution
methods:
-init(min, max) :: constructor
-next(id) :: returns next number in the distribution
id - engine ID to pass to native function
-int_distribution
methods:
-init(min, max) :: constructor
-next(id) :: returns next number in the distribution
id - engine ID to pass to native function
-bool_distribution
methods:
-init(min, max) :: constructor
-next(id) :: returns next boolean in the distribution
id - engine ID to pass to native function
-num_sequence
methods:
-init(a, b) :: constructor
-add(num) :: adds num to the end of the number sequence
-shuffle() :: shuffles the sequence of numbers
-next() :: returns next number in the sequence
Adds missing function exports.
Fixes numerous problems I won't go into