aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/src/enemy_creator.hpp
blob: e477a2f6e2d6cd332d85f65be4cfb7c2f3134df7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include "interfaces/enemy.hpp"
#include "interfaces/enemy_creator.hpp"

#include <yacppdic/auto_wirable.hpp>
#include <yacppdic/tagging.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;

	auto create_small_enemy() noexcept -> std::unique_ptr<IEnemy> override;

	auto create_big_enemy() noexcept -> std::unique_ptr<IEnemy> override;

private:
	IEnemyFactory _small_enemy_factory;
	IEnemyFactory _big_enemy_factory;
};