diff options
author | raczman <none@none> | 2009-05-15 22:41:13 +0200 |
---|---|---|
committer | raczman <none@none> | 2009-05-15 22:41:13 +0200 |
commit | c66877019ee228193b9d68c6e8b886d5ffa1d9d5 (patch) | |
tree | 03f8dacacbab3c252163305dc6dcd227503ba5d4 /src/game/Map.h | |
parent | 5d78a9c6bdac0ec6f24327d3dc86ea6c63aec917 (diff) |
Added MTRand object to Map class.
This is first step of getting rid of static MTRandTSS object.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Map.h')
-rw-r--r-- | src/game/Map.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/game/Map.h b/src/game/Map.h index f117a1c1cec..334a61cd2ff 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -33,6 +33,7 @@ #include "SharedDefines.h" #include "GameSystem/GridRefManager.h" #include "MapRefManager.h" +#include "mersennetwister/MersenneTwister.h" #include <bitset> #include <list> @@ -278,6 +279,33 @@ class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::O template<class NOTIFIER> void VisitWorld(const float &x, const float &y, float radius, NOTIFIER ¬ifier); template<class NOTIFIER> void VisitGrid(const float &x, const float &y, float radius, NOTIFIER ¬ifier); CreatureGroupHolderType CreatureGroupHolder; + MTRand mtRand; + + int32 irand(int32 min, int32 max) + { + return int32 (mtRand.randInt(max - min)) + min; + } + + uint32 urand(uint32 min, uint32 max) + { + return mtRand.randInt(max - min) + min; + } + + int32 rand32() + { + return mtRand.randInt(); + } + + double rand_norm(void) + { + return mtRand.randExc(); + } + + double rand_chance(void) + { + return mtRand.randExc(100.0); + } + private: void LoadVMap(int pX, int pY); void LoadMap(uint32 mapid, uint32 instanceid, int x,int y); |