You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.7 KiB

3 years ago
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ClapTrap.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/23 10:54:07 by narnaud #+# #+# */
3 years ago
/* Updated: 2022/06/24 07:50:53 by narnaud ### ########.fr */
3 years ago
/* */
/* ************************************************************************** */
#pragma once
#define CT_HEALTH 10
#define CT_ENERGY 10
3 years ago
#define CT_DMG 0
3 years ago
#include <string>
#include <iostream>
using std::cout;
using std::endl;
class ClapTrap {
public:
static ClapTrap *registery[128];
static int amount;
ClapTrap (void);
ClapTrap (std::string name, size_t hp = CT_HEALTH,\
size_t ep = CT_ENERGY, size_t atk = CT_DMG);
ClapTrap (ClapTrap const & src);
virtual ~ClapTrap (void);
ClapTrap & operator= (ClapTrap const & src);
virtual void attack(const std::string& target);
void takeDamage(unsigned int amount);
void beRepaired(unsigned int amount);
std::string getName(void) const;
static ClapTrap *getClapTrap(std::string name);
protected:
std::string _name;
unsigned int _health;
unsigned int _energy;
unsigned int _attack;
unsigned int _id;
};