Player icon indicating copy to clipboard operation
Player copied to clipboard

RNG refactoring

Open DNKpp opened this issue 4 years ago • 3 comments

As already discussed on discord, the current workflow of locking and unlocking rng seems quite dirty. My solution is wrapping the rng in a simple polymorphic adapter class, which let's us exchange the behavior during runtime (e.g. for tests). I also added a simple ScopedRNGWrapper class, which will exchange the current global rng with a newly created one and exchanges it back on destruction.

Finally I added some test cases.

DNKpp avatar Feb 17 '21 16:02 DNKpp

Jenkins: Test this please

Ghabry avatar Feb 17 '21 19:02 Ghabry

Well, I've mixed up the c++ versions. Most _v type_trait suffixes are from c++17. Questions is, when do you plan upgrading version? If it's planned for the near future I'll simply wait and instead upgrading the other parts to c++17 .

DNKpp avatar Feb 17 '21 21:02 DNKpp

Since we do use c++17 now, this should be looked at again...

carstene1ns avatar Mar 07 '24 21:03 carstene1ns