aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/src/interfaces/enemy.hpp
blob: 5f49ca67fcb930f7dc48ad1e7434097d1607db44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include <yacppdic/factory.hpp>

#include <memory>

constexpr char SMALL_ENEMY_TAG[] = "small";
constexpr char BIG_ENEMY_TAG[] = "big";

class IEnemy
{
public:
	virtual ~IEnemy() noexcept = default;

	virtual int get_health() const noexcept = 0;

	virtual void do_damage(int damage) noexcept = 0;
};

using IEnemyFactory = yacppdic::Factory<std::unique_ptr<IEnemy>()>;