2022-09-19 01:34:57 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
2022-11-17 07:46:07 +00:00
|
|
|
File: AuRNGStaticUtilities.cpp
|
2022-09-19 01:34:57 +00:00
|
|
|
Date: 2022-9-17
|
|
|
|
File: RNG.cpp
|
|
|
|
Date: 2021-6-11
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#include <Source/RuntimeInternal.hpp>
|
2022-11-17 07:46:07 +00:00
|
|
|
#include "AuRNG.hpp"
|
|
|
|
#include "AuRNGStaticUtilities.hpp"
|
2022-09-19 01:34:57 +00:00
|
|
|
|
|
|
|
namespace Aurora::RNG
|
|
|
|
{
|
2022-11-17 07:46:07 +00:00
|
|
|
AUKN_SYM AuString ReadString(AuUInt32 dwLength, ERngStringCharacters type)
|
2022-09-19 01:34:57 +00:00
|
|
|
{
|
2022-11-17 07:46:07 +00:00
|
|
|
return gFastDevice->NextString(dwLength, type);
|
2022-09-19 01:34:57 +00:00
|
|
|
}
|
|
|
|
|
2022-11-17 07:46:07 +00:00
|
|
|
AUKN_SYM void RngString(char *pString, AuUInt32 dwLength, ERngStringCharacters type)
|
2022-09-19 01:34:57 +00:00
|
|
|
{
|
2022-11-17 07:46:07 +00:00
|
|
|
gFastDevice->NextString(pString, dwLength, type);
|
2022-09-19 01:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM AuUInt8 RngByte()
|
|
|
|
{
|
|
|
|
return gFastDevice->NextByte();
|
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM bool RngBoolean()
|
|
|
|
{
|
|
|
|
return gFastDevice->NextBoolean();
|
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM AuUInt32 RngU32()
|
|
|
|
{
|
|
|
|
return gFastDevice->NextU32();
|
|
|
|
}
|
|
|
|
|
2022-11-17 07:46:07 +00:00
|
|
|
AUKN_SYM AuUInt32 RngU32(AuUInt32 uMin, AuUInt32 uMax)
|
2022-09-19 01:34:57 +00:00
|
|
|
{
|
2022-11-17 07:46:07 +00:00
|
|
|
return gFastDevice->NextU32(uMin, uMax);
|
2022-09-19 01:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM AuUInt64 RngU64()
|
|
|
|
{
|
|
|
|
return gFastDevice->NextU64();
|
|
|
|
}
|
|
|
|
|
2022-11-17 07:46:07 +00:00
|
|
|
AUKN_SYM AuInt32 RngInt(AuInt32 uMin, AuInt32 uMax)
|
2022-09-19 01:34:57 +00:00
|
|
|
{
|
2022-11-17 07:46:07 +00:00
|
|
|
return gFastDevice->NextInt(uMin, uMax);
|
2022-09-19 01:34:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM double RngDecimal()
|
|
|
|
{
|
|
|
|
return gFastDevice->NextDecimal();
|
|
|
|
}
|
|
|
|
|
|
|
|
AUKN_SYM float RngNumber(float min, float max)
|
|
|
|
{
|
|
|
|
return gFastDevice->NextNumber(min, max);
|
|
|
|
}
|
|
|
|
|
2022-11-17 07:46:07 +00:00
|
|
|
AUKN_SYM AuUInt32 RngIndex(AuUInt32 uCount /* = max + 1*/)
|
2022-09-19 01:34:57 +00:00
|
|
|
{
|
2022-11-17 07:46:07 +00:00
|
|
|
return gFastDevice->NextIndex(uCount);
|
2022-09-19 01:34:57 +00:00
|
|
|
}
|
|
|
|
}
|