d03 ex01 debut

This commit is contained in:
Hugo LAMY
2022-02-17 19:59:25 +01:00
parent 1640b9a15d
commit 8cbff6a7c5
8 changed files with 383 additions and 1 deletions

46
d03/ex01/ClapTrap.hpp Normal file
View File

@@ -0,0 +1,46 @@
#ifndef CLAPTRAP_HPP
# define CLAPTRAP_HPP
#include <iostream>
#include <sstream>
#include <string>
#include <color.h>
class ClapTrap {
public:
ClapTrap( void ); // default/parametric constructor
ClapTrap( std::string name ); // default/parametric constructor
ClapTrap( ClapTrap const & src ); // copy constructor
~ClapTrap( void ); // destructor
ClapTrap & operator=( ClapTrap const & rhs ); // assignement operator
void attack(const std::string & target);
void takeDamage(unsigned int amount);
void beRepaired(unsigned int amount);
std::string getName() const;
int getHit() const;
int getEnergy() const;
int getAttack() const;
protected:
std::string _name;
int _hit;
int _energy;
int _attack;
void _getNumber();
void _increaseNumber();
private:
static int _number;
};
#endif