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.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/randomization/seed_generator.hpp (limited to 'src/randomization/seed_generator.hpp') diff --git a/src/randomization/seed_generator.hpp b/src/randomization/seed_generator.hpp new file mode 100644 index 0000000..238fdbe --- /dev/null +++ b/src/randomization/seed_generator.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include "interfaces/randomization.hpp" + +#include +#include + +class SeedGenerator : public ISeedGenerator +{ +public: + explicit SeedGenerator(const std::shared_ptr &random_device); + + [[nodiscard]] unsigned int random_seed() const override; + +private: + const std::shared_ptr &_random_device; +}; -- cgit v1.2.3-18-g5258