-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClapTrap.hpp
52 lines (43 loc) · 1.67 KB
/
ClapTrap.hpp
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
48
49
50
51
52
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ClapTrap.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wcorrea- <wcorrea-@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/17 14:03:27 by wcorrea- #+# #+# */
/* Updated: 2023/07/24 16:49:54 by wcorrea- ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef CLAPTRAP_HPP
# define CLAPTRAP_HPP
# include <iostream>
# include <cstdlib>
class ClapTrap
{
private:
std::string _name;
int _hitPoints;
int _energyPoints;
int _attackDamage;
public:
// Constructors and destructor
ClapTrap(void);
ClapTrap(std::string name);
ClapTrap(ClapTrap const ©);
~ClapTrap(void);
// Operators
ClapTrap &operator=(ClapTrap const ©);
// Get functions
std::string getName(void) const;
int getHitPoints(void) const;
int getEnergyPoints(void) const;
int getAttackDamage(void) const;
// Member functions
void attack(const std::string& target);
void takeDamage(unsigned int amount);
void beRepaired(unsigned int amount);
bool isGameOver(void);
};
std::ostream &operator<<(std::ostream &out, ClapTrap const &trap);
#endif