aboutsummaryrefslogtreecommitdiff
path: root/backend/Enemy.h
blob: 4db2ae8d66ba458a3b798622fa07c0564b353831 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once

#include "String.h"
#include "PtrList.h"
#include "ListIterator.h"
#include "Object.h"

class Enemy {
public:
	void set_name(const String & name);
	const String & get_name() const;
	void set_description(const String & description);
	const String & get_description() const;
	void set_health(unsigned);
	unsigned get_health() const;
	bool is_dead() const;
	void take_damage(unsigned int dmg);
	virtual const String & get_displayname() const;
	void set_attack(float attack_chance);
	float get_attack() const;
	void set_damage_min(int damage_min);
	int get_damage_min() const;
	void set_damage_max(int damage_max);
	int get_damage_max() const;

	void add_hidden_object(Object *);
	void remove_hidden_object(Object *);
	ListRange<Object *> get_hidden_objects();

private:
	friend class EnemyFactory;
	Enemy(const String & name, const String & description);
public:
	virtual ~Enemy() = default;

private:
	String name;
	String description;
	PtrList<Object> hidden_objects;
	unsigned int health_points = 0;
	float attack_chance = 0.0;
	int damage_min = 0;
	int damage_max = 0;
};