aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-04-30 16:28:13 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:58 +0200
commit40d02748924aa7c48b04cf948204d8dacdfbbc74 (patch)
tree4d07a3703207295799b02cef52618a8f0c820542 /src/interfaces
parentdb6edcd473a684420e9a7611b24462df21165c1b (diff)
refactor: replace DI files with the yacppdic library
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/game.hpp4
-rw-r--r--src/interfaces/generation_tracker.hpp4
-rw-r--r--src/interfaces/matrix.hpp6
-rw-r--r--src/interfaces/randomization.hpp4
-rw-r--r--src/interfaces/scene.hpp4
-rw-r--r--src/interfaces/status_updater.hpp5
-rw-r--r--src/interfaces/statusline.hpp4
7 files changed, 17 insertions, 14 deletions
diff --git a/src/interfaces/game.hpp b/src/interfaces/game.hpp
index 6d247d9..dee2218 100644
--- a/src/interfaces/game.hpp
+++ b/src/interfaces/game.hpp
@@ -5,7 +5,7 @@
#include "interfaces/scene.hpp"
#include "interfaces/window.hpp"
-#include "DI/factory.hpp"
+#include <yacppdic/factory.hpp>
#include <memory>
#include <unordered_map>
@@ -32,7 +32,7 @@ using IGameFactory = std::unique_ptr<IGame> (*)(
const std::shared_ptr<ICursorController> &cursor_controller);
*/
-using IGameFactory = Factory<std::unique_ptr<IGame>(
+using IGameFactory = yacppdic::Factory<std::unique_ptr<IGame>(
const std::shared_ptr<IWindow> &window,
const std::shared_ptr<IScene> &scene,
const std::shared_ptr<ICursorController> &cursor_controller
diff --git a/src/interfaces/generation_tracker.hpp b/src/interfaces/generation_tracker.hpp
index fd2c130..ca2e36b 100644
--- a/src/interfaces/generation_tracker.hpp
+++ b/src/interfaces/generation_tracker.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "DI/factory.hpp"
+#include <yacppdic/factory.hpp>
#include <cstdint>
#include <memory>
@@ -19,4 +19,4 @@ public:
};
using IGenerationTrackerFactory =
- Factory<std::unique_ptr<IGenerationTracker>(bool is_paused)>;
+ yacppdic::Factory<std::unique_ptr<IGenerationTracker>(bool is_paused)>;
diff --git a/src/interfaces/matrix.hpp b/src/interfaces/matrix.hpp
index 7fea003..5a01943 100644
--- a/src/interfaces/matrix.hpp
+++ b/src/interfaces/matrix.hpp
@@ -1,10 +1,11 @@
#pragma once
-#include "DI/factory.hpp"
#include "engine/data/bounds.hpp"
#include "engine/data/vector2.hpp"
#include "engine/matrix_iterator.hpp"
+#include <yacppdic/factory.hpp>
+
#include <memory>
template <typename Element>
@@ -39,4 +40,5 @@ public:
};
template <typename Element>
-using IMatrixFactory = Factory<std::unique_ptr<IMatrix<Element>>(const Bounds &bounds)>;
+using IMatrixFactory =
+ yacppdic::Factory<std::unique_ptr<IMatrix<Element>>(const Bounds &bounds)>;
diff --git a/src/interfaces/randomization.hpp b/src/interfaces/randomization.hpp
index 26426e3..06f7d49 100644
--- a/src/interfaces/randomization.hpp
+++ b/src/interfaces/randomization.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "DI/factory.hpp"
+#include <yacppdic/factory.hpp>
#include <memory>
@@ -30,4 +30,4 @@ public:
};
using IRandomNumberGeneratorFactory =
- Factory<std::unique_ptr<IRandomNumberGenerator>(const uint32_t &seed)>;
+ yacppdic::Factory<std::unique_ptr<IRandomNumberGenerator>(const uint32_t &seed)>;
diff --git a/src/interfaces/scene.hpp b/src/interfaces/scene.hpp
index 88cb3b1..105b173 100644
--- a/src/interfaces/scene.hpp
+++ b/src/interfaces/scene.hpp
@@ -4,7 +4,7 @@
#include "interfaces/matrix.hpp"
#include "interfaces/window.hpp"
-#include "DI/factory.hpp"
+#include <yacppdic/factory.hpp>
#include <memory>
@@ -22,7 +22,7 @@ public:
-> const std::shared_ptr<IMatrix<std::string_view>> & = 0;
};
-using ISceneFactory = Factory<std::unique_ptr<IScene>(
+using ISceneFactory = yacppdic::Factory<std::unique_ptr<IScene>(
const std::shared_ptr<ICursorController> &cursor_controller,
const std::shared_ptr<IWindow> &window
)>;
diff --git a/src/interfaces/status_updater.hpp b/src/interfaces/status_updater.hpp
index 83b2bf2..4b2ceb1 100644
--- a/src/interfaces/status_updater.hpp
+++ b/src/interfaces/status_updater.hpp
@@ -4,9 +4,10 @@
#include "interfaces/statusline.hpp"
#include "interfaces/subscriber.hpp"
-#include "DI/factory.hpp"
#include "engine/data/vector2.hpp"
+#include <yacppdic/factory.hpp>
+
#include <memory>
// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
@@ -16,7 +17,7 @@ public:
void update(const Vector2 &context) noexcept override = 0;
};
-using IStatusUpdaterFactory = Factory<std::unique_ptr<IStatusUpdater>(
+using IStatusUpdaterFactory = yacppdic::Factory<std::unique_ptr<IStatusUpdater>(
const std::shared_ptr<IStatusLine> &statusline,
const std::shared_ptr<IGenerationTracker> &generation_tracker
)>;
diff --git a/src/interfaces/statusline.hpp b/src/interfaces/statusline.hpp
index c104fad..0da295e 100644
--- a/src/interfaces/statusline.hpp
+++ b/src/interfaces/statusline.hpp
@@ -3,7 +3,7 @@
#include "interfaces/cursor.hpp"
#include "interfaces/window.hpp"
-#include "DI/factory.hpp"
+#include <yacppdic/factory.hpp>
#include <string_view>
@@ -27,7 +27,7 @@ public:
) noexcept = 0;
};
-using IStatusLineFactory = Factory<std::unique_ptr<IStatusLine>(
+using IStatusLineFactory = yacppdic::Factory<std::unique_ptr<IStatusLine>(
const std::shared_ptr<ICursorController> &cursor_controller,
const std::shared_ptr<IWindow> &window
)>;