aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/src/enemy_creator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/basic/src/enemy_creator.cpp')
-rw-r--r--examples/basic/src/enemy_creator.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/basic/src/enemy_creator.cpp b/examples/basic/src/enemy_creator.cpp
new file mode 100644
index 0000000..820ce1b
--- /dev/null
+++ b/examples/basic/src/enemy_creator.cpp
@@ -0,0 +1,19 @@
+#include "enemy_creator.hpp"
+
+EnemyCreator::EnemyCreator(
+ IEnemyFactory small_enemy_factory,
+ IEnemyFactory big_enemy_factory
+) noexcept
+ : _small_enemy_factory(small_enemy_factory), _big_enemy_factory(big_enemy_factory)
+{
+}
+
+std::unique_ptr<IEnemy> EnemyCreator::create_small_enemy() noexcept
+{
+ return _small_enemy_factory();
+}
+
+std::unique_ptr<IEnemy> EnemyCreator::create_big_enemy() noexcept
+{
+ return _big_enemy_factory();
+}