示例#1
0
double rand_chance()
{
    return GetRng()->Random() * 100.0;
}
示例#2
0
uint32 rand32()
{
    return GetRng()->BRandom();
}
示例#3
0
double rand_norm()
{
    return GetRng()->Random();
}
示例#4
0
float frand(float min, float max)
{
    ASSERT(max >= min);
    return float(GetRng()->Random() * (max - min) + min);
}
示例#5
0
uint32 urandms(uint32 min, uint32 max)
{
    ASSERT(max >= min);
    ASSERT(INT_MAX / IN_MILLISECONDS >= max);
    return GetRng()->URandom(min * IN_MILLISECONDS, max * IN_MILLISECONDS);
}
示例#6
0
uint32 urand(uint32 min, uint32 max)
{
    ASSERT(max >= min);
    return GetRng()->URandom(min, max);
}
示例#7
0
int32 irand(int32 min, int32 max)
{
    ASSERT(max >= min);
    return int32(GetRng()->IRandom(min, max));
}
示例#8
0
uint32 urandms(uint32 min, uint32 max)
{
    ASSERT(max >= min);
    ASSERT(std::numeric_limits<uint32>::max() / Milliseconds::period::den >= max);
    return GetRng()->URandom(min * Milliseconds::period::den, max * Milliseconds::period::den);
}