aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities/Random.cpp
AgeCommit message (Collapse)Author
2025-07-09Core/Random: Use standard aligned operator new and remove RandomEngine ↵Shauren
singleton instance (it is trivially constructible)
2023-10-31Core/Random: Changed random functions returning doubles to return floatsShauren
* They were all cast to float at use anyway * Improves roll_chance_f performance (rand32() is now called internally by uniform_real_distribution once instead of twice)
2022-01-23Core/Threads: Replace Boost TLS with C++11 one (#15782)Giacomo Pozzoni
* Core/Threads: Replace Boost TLS with C++11 one Replace boost::thread_specific_ptr<T> thread-local storage with C++11 thread_local to remove libboost_thread dependency from common project * Fix no-pch build (cherry picked from commit 00b16992f1ae3bf14ab5fe6366028a2b8648bfa0)
2021-12-19Core/Random: Refactor random number generation to use ↵Shauren
std::uniform_*_distribution to restrict result range instead of doing that ourselves * Seed SFMTRand with more values for its state (cherry picked from commit 73bc3d8ea49a4793b14976e86010a36f19c1d18b)
2021-12-19Dep/SFMT: updated to newest upstream version from ↵daMaex
https://github.com/MersenneTwister-Lab/SFMT * only needed files added * used CMake and SFMTRand from https://github.com/TrinityCore/TrinityCore/pull/23240 (Thank you Artox) (cherry picked from commit 4e0279b0e48c9992842010b9f3f132e54a460128)
2021-10-14Misc: Pass std::chrono types by value everywhere.Treeston
(cherry picked from commit 2ef9d301f0869b443122e2ba543af054c5b0e53c)
2020-01-02New YearAokromes
2019-01-01Update copyright note for 2019vincent-michael
auto happy = new year(2019);
2018-01-01Update copyright note for 2018vincent-michael
auto happy = new year(2018);
2017-06-07Core/Misc: Some /W4 warning fixesShauren
2017-05-11Core/Common: Include cleanupShauren
2017-03-21Core/Utils: Changed all Trinity::Containers utilities to work on all ↵Shauren
container types (including arrays where it makes sense) * Added MapGetValuePtr to allow writing `if (Val* v = MapGetValuePtr(map, key))` * Added utility IteratorPair class with begin/end methods and MapEqualRange for use in range for syntax with multimaps
2017-01-01Update copyright note for 2017vincent-michael
Happy new year
2016-04-08Util/Random: Add randtime(Milliseconds const&, Milliseconds const&) to ↵treeston
supersede urandms(uint32,uint32) for scripts being ported to std::chrono. (cherry picked from commit 224b42c53a6ae212f2d1d550903e019ab8a741d6)
2016-01-01Update copyright note for 2016Vincent-Michael
Happy new year (Again new year with idiots ...)
2015-12-24Core/Utils: Moved rng functions to separate header and added utility ↵Shauren
functions to select a random element from a container where each element can have different chance of being selected