Added MTRand object to Map class.
This is first step of getting rid of static MTRandTSS object. --HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user