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.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/basic/src/enemy_creator.hpp (limited to 'examples/basic/src/enemy_creator.hpp') diff --git a/examples/basic/src/enemy_creator.hpp b/examples/basic/src/enemy_creator.hpp new file mode 100644 index 0000000..a220008 --- /dev/null +++ b/examples/basic/src/enemy_creator.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "interfaces/enemy.hpp" +#include "interfaces/enemy_creator.hpp" + +#include +#include + +class EnemyCreator : public IEnemyCreator, + public yacppdic::AutoWirable< + IEnemyCreator, + EnemyCreator, + yacppdic::Tagged, + yacppdic::Tagged> +{ +public: + EnemyCreator( + IEnemyFactory small_enemy_factory, + IEnemyFactory big_enemy_factory + ) noexcept; + + std::unique_ptr create_small_enemy() noexcept override; + + std::unique_ptr create_big_enemy() noexcept override; + +private: + IEnemyFactory _small_enemy_factory; + IEnemyFactory _big_enemy_factory; +}; -- cgit v1.2.3-18-g5258