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:
lotodore
2011-02-27 21:54:43 +00:00
parent 9c2dc64fbd
commit 9e425136f1
2 changed files with 72 additions and 0 deletions
+5
View File
@@ -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);
};