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.
 
 

42 lines
1.5 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ClapTrap.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/23 10:54:07 by narnaud #+# #+# */
/* Updated: 2022/06/24 07:51:12 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#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);
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;
};