blob: 7132125e529aa952982734c89ad5cb03dec9ac5f (
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
|
#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";
constexpr auto SMALL_ENEMY_HEALTH = 65;
constexpr auto BIG_ENEMY_HEALTH = 130;
// 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>()>;
|