Adding new types of random number generators: 1. shuffle a list non-deterministic (not the default shuffle) 2. get random numbers of a range 3. get random numbers of a range, without duplicates (the latest based on floty's idea). Note that the existing random number works quite well, the new approach uses boost::random and is more flexible if other distributions are needed for the AI.
The code is currently disabled due to link problems on debian/ubuntu (boost::random seems to be missing there).
This commit is contained in:
@@ -23,6 +23,11 @@
|
||||
class Tools
|
||||
{
|
||||
public:
|
||||
|
||||
static void ShuffleArrayNonDeterministic(int *inout, unsigned count);
|
||||
static void GetRand(int minValue, int maxValue, unsigned count, int *out);
|
||||
static void GetRandUnique(int minValue, int maxValue, unsigned count, int *out);
|
||||
|
||||
static void getRandNumber(int, int, int, int*, bool, int* = 0, int = 0);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user