From 3957dfb9361e864f6362e59655c885f52b39371f Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 6 May 2022 18:23:42 +0200 Subject: docs: add tagging to basic example --- examples/basic/src/enemy_creator.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/basic/src/enemy_creator.cpp (limited to 'examples/basic/src/enemy_creator.cpp') 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 EnemyCreator::create_small_enemy() noexcept +{ + return _small_enemy_factory(); +} + +std::unique_ptr EnemyCreator::create_big_enemy() noexcept +{ + return _big_enemy_factory(); +} -- cgit v1.2.3-18-g5258