diff options
Diffstat (limited to 'examples/basic/src/enemy_creator.hpp')
-rw-r--r-- | examples/basic/src/enemy_creator.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
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 <yacppdic/auto_wirable.hpp> +#include <yacppdic/tagged.hpp> + +class EnemyCreator : public IEnemyCreator, + public yacppdic::AutoWirable< + IEnemyCreator, + EnemyCreator, + yacppdic::Tagged<IEnemyFactory, SMALL_ENEMY_TAG>, + yacppdic::Tagged<IEnemyFactory, BIG_ENEMY_TAG>> +{ +public: + EnemyCreator( + IEnemyFactory small_enemy_factory, + IEnemyFactory big_enemy_factory + ) noexcept; + + std::unique_ptr<IEnemy> create_small_enemy() noexcept override; + + std::unique_ptr<IEnemy> create_big_enemy() noexcept override; + +private: + IEnemyFactory _small_enemy_factory; + IEnemyFactory _big_enemy_factory; +}; |