mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 19:13:49 +00:00
feat(Core/Random): port random system from TrinityCore (#5454)
* feat(Core/Random): port random system from TrinityCore * lic * logic correct * MultimapErasePair move * whitespace 17:13:34 1. 'Containers.h'. Replace (1) 17:13:40 2. 'LootMgr.h'. Replace (1) 17:13:44 3. 'World.cpp'. Replace (1) 17:13:47 4. 'instance_scholomance.cpp'. Replace (1) * correct debug build
This commit is contained in:
33
src/common/Utilities/SFMTRand.h
Normal file
33
src/common/Utilities/SFMTRand.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
* Copyright (C) 2008-2021 TrinityCore <http://www.trinitycore.org/>
|
||||
*/
|
||||
|
||||
#ifndef SFMTRand_h__
|
||||
#define SFMTRand_h__
|
||||
|
||||
#include "Define.h"
|
||||
#include <SFMT.h>
|
||||
#include <new>
|
||||
|
||||
/*
|
||||
* C++ Wrapper for SFMT
|
||||
*/
|
||||
class SFMTRand
|
||||
{
|
||||
public:
|
||||
SFMTRand();
|
||||
uint32 RandomUInt32(); // Output random bits
|
||||
void* operator new(size_t size, std::nothrow_t const&);
|
||||
void operator delete(void* ptr, std::nothrow_t const&);
|
||||
void* operator new(size_t size);
|
||||
void operator delete(void* ptr);
|
||||
void* operator new[](size_t size, std::nothrow_t const&);
|
||||
void operator delete[](void* ptr, std::nothrow_t const&);
|
||||
void* operator new[](size_t size);
|
||||
void operator delete[](void* ptr);
|
||||
private:
|
||||
sfmt_t _state;
|
||||
};
|
||||
|
||||
#endif // SFMTRand_h__
|
||||
Reference in New Issue
Block a user