aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/src/enemy_creator.cpp
blob: fd8a80917f7a2909c3f83725f96ee57030e63849 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "enemy_creator.hpp"

#include <utility>


EnemyCreator::EnemyCreator(
	IEnemyFactory small_enemy_factory,
	IEnemyFactory big_enemy_factory
) noexcept
	: _small_enemy_factory(std::move(std::move(small_enemy_factory))), _big_enemy_factory(std::move(std::move(big_enemy_factory)))
{
}

auto EnemyCreator::create_small_enemy() noexcept -> std::unique_ptr<IEnemy>
{
	return _small_enemy_factory();
}

auto EnemyCreator::create_big_enemy() noexcept -> std::unique_ptr<IEnemy>
{
	return _big_enemy_factory();
}