-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.h
More file actions
47 lines (32 loc) · 1.37 KB
/
Player.h
File metadata and controls
47 lines (32 loc) · 1.37 KB
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
46
47
//
// Created by Nativ on 18/01/2025.
//
#ifndef PLAYER_H
#define PLAYER_H
#include "Entity.h"
class Player: public Entity {
protected:
//will be controlled at the Game class
int roundCounter;
bool readyForSpecialAttack;
public:
//Constructors
Player() : Entity(), roundCounter(0), readyForSpecialAttack(true) {};
//initialized rounctCounter with -1 for the first round in the game
Player(const string &name, int maxAmountOfLife, int damageValue) : Entity(name, maxAmountOfLife, damageValue), roundCounter(-1),readyForSpecialAttack(true){};
//Destructor
virtual ~Player();
//copy constructor and assignment operator
Player(const Player& other) : Entity(other), roundCounter(other.roundCounter), readyForSpecialAttack(other.readyForSpecialAttack) {};
Player& operator=(const Player& other);
//special ability player methods
void addToRoundCounter();
void resetRoundCounter();
virtual bool IsItPossibleUseTheSpecialAttack() const=0;
friend ostream& operator<<(ostream& os, const Player& other);
virtual Player& PlayerAttackedByGoblin(const Monster &monster)=0;
virtual Player& PlayerAttackedByDragon(const Monster &monster)=0;
virtual bool operator<(const Entity& other) const;
virtual bool operator>(const Entity& other) const;
};
#endif //PLAYER_H