From 5864e5abc43b201c3801fa39a2fcaf9e3a9e8914 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 27 Feb 2022 12:54:10 +0100 Subject: refactor: use dependency injection --- src/randomization/seed_generator.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/randomization/seed_generator.cpp (limited to 'src/randomization/seed_generator.cpp') diff --git a/src/randomization/seed_generator.cpp b/src/randomization/seed_generator.cpp new file mode 100644 index 0000000..fdb2b12 --- /dev/null +++ b/src/randomization/seed_generator.cpp @@ -0,0 +1,11 @@ +#include "seed_generator.hpp" + +SeedGenerator::SeedGenerator(const std::shared_ptr &random_device) + : _random_device(random_device) +{ +} + +unsigned int SeedGenerator::random_seed() const +{ + return (*_random_device)(); +} -- cgit v1.2.3-18-g5258