19 Commits

Author SHA1 Message Date
Shauren
2c74626e66 Core/Random: Use standard aligned operator new and remove RandomEngine singleton instance (it is trivially constructible) 2025-07-09 12:20:10 +02:00
Shauren
9894f6b802 Core/Random: Changed random functions returning doubles to return floats
* 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)
2023-10-31 20:20:00 +01:00
Shauren
b93bf95f2e Core/Random: Refactor random number generation to use std::uniform_*_distribution to restrict result range instead of doing that ourselves
* Seed SFMTRand with more values for its state

(cherry picked from commit 73bc3d8ea4)
2021-12-19 00:13:11 +01:00
Treeston
3418a33a87 Misc: Pass std::chrono types by value everywhere.
(cherry picked from commit 2ef9d301f0)
2021-10-14 19:39:42 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
3a418a0bbc Core/Common: Include cleanup 2017-05-11 22:29:51 +02:00
Shauren
a1e3b54e07 Core/Utils: Changed all Trinity::Containers utilities to work on all 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-03-21 21:04:01 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren
59fe908744 Core/Random: Remove no longer needed hack for VS 2013 2016-09-01 11:52:08 +02:00
Naios
b74aadca23 Core/Define: Remove the conditional macro for constexpr.
* Not needed anymore since the requirements were raised to MSVC 2015.

(cherry picked from commit da3c03a48b)
2016-08-29 22:07:24 +02:00
Shauren
a82f6aa4cc Core/Misc: Build fix for dynamic linking 2016-04-10 17:58:05 +02:00
treeston
cf7436b644 Util/Random: Add randtime(Milliseconds const&, Milliseconds const&) to supersede urandms(uint32,uint32) for scripts being ported to std::chrono.
(cherry picked from commit 224b42c53a)
2016-04-08 22:57:01 +02:00
Naios
501fd9b502 Core/Common: Converted the common library to a shared library.
* There is still the possibility to static link against common.
2016-03-24 01:28:58 +01:00
Shauren
bc94bacce4 Core/Misc: Build fix for clang & libc++ 2016-01-09 01:38:59 +01:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Shauren
9ab10d6e68 Core/Misc: VS 2013 build fix - horrible hack. 2015-12-27 01:21:30 +01:00
Shauren
ae20b2ab56 Core/Utils: Moved rng functions to separate header and added utility functions to select a random element from a container where each element can have different chance of being selected 2015-12-24 19:48:39 +01:00