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

#include <yacppdic/factory.hpp>
#include <yacppdic/tagging.hpp>

#include <memory>

constexpr yacppdic::Tag SMALL_ENEMY_TAG = "small";
constexpr yacppdic::Tag BIG_ENEMY_TAG = "big";

// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class IEnemy
{
public:
	virtual ~IEnemy() noexcept = default;

	[[nodiscard]] virtual auto get_health() const noexcept -> int = 0;

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

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