From cf3bfd60ad03f2feb2ccc62a12fc2922bdc2fb71 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 2 Jun 2022 20:07:09 +0200 Subject: refactor: remove randomization & argument parser --- src/randomization/generator.cpp | 14 -------------- src/randomization/generator.hpp | 18 ------------------ src/randomization/seed_generator.cpp | 6 ------ src/randomization/seed_generator.hpp | 19 ------------------- 4 files changed, 57 deletions(-) delete mode 100644 src/randomization/generator.cpp delete mode 100644 src/randomization/generator.hpp delete mode 100644 src/randomization/seed_generator.cpp delete mode 100644 src/randomization/seed_generator.hpp (limited to 'src/randomization') diff --git a/src/randomization/generator.cpp b/src/randomization/generator.cpp deleted file mode 100644 index 49adb97..0000000 --- a/src/randomization/generator.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "generator.hpp" - -RandomNumberGenerator::RandomNumberGenerator(const uint32_t &seed) noexcept -{ - this->_generator = std::make_unique(seed); -} - -auto RandomNumberGenerator::in_range(const uint32_t &a, const uint32_t &b) const noexcept - -> uint32_t -{ - auto random_distribution = std::uniform_int_distribution(a, b); - - return random_distribution(*this->_generator); -} diff --git a/src/randomization/generator.hpp b/src/randomization/generator.hpp deleted file mode 100644 index 24b9bd6..0000000 --- a/src/randomization/generator.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "interfaces/randomization.hpp" - -#include -#include - -class RandomNumberGenerator : public IRandomNumberGenerator -{ -public: - explicit RandomNumberGenerator(const uint32_t &seed) noexcept; - - [[nodiscard]] auto in_range(const uint32_t &a, const uint32_t &b) const noexcept - -> uint32_t override; - -private: - std::unique_ptr _generator; -}; diff --git a/src/randomization/seed_generator.cpp b/src/randomization/seed_generator.cpp deleted file mode 100644 index a0f9303..0000000 --- a/src/randomization/seed_generator.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "seed_generator.hpp" - -auto SeedGenerator::random_seed() noexcept -> uint32_t -{ - return _random_device(); -} diff --git a/src/randomization/seed_generator.hpp b/src/randomization/seed_generator.hpp deleted file mode 100644 index 3584966..0000000 --- a/src/randomization/seed_generator.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include "interfaces/randomization.hpp" - -#include - -#include - -class SeedGenerator : public ISeedGenerator, - public yacppdic::AutoWirable -{ -public: - SeedGenerator() noexcept = default; - - [[nodiscard]] auto random_seed() noexcept -> uint32_t override; - -private: - std::random_device _random_device; -}; -- cgit v1.2.3-18-g5258