d03 ex03 introduction template pour main

This commit is contained in:
Hugo LAMY
2022-02-19 10:03:39 +01:00
parent a2bd7db6a9
commit 817fac957b
10 changed files with 476 additions and 0 deletions

49
d03/ex03/ClapTrap.hpp Normal file
View File

@@ -0,0 +1,49 @@
#ifndef CLAPTRAP_HPP
# define CLAPTRAP_HPP
#include <iostream>
#include <sstream>
#include <string>
#include <color.h>
class ClapTrap {
public:
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 const _name;
std::string _class;
int _hit;
int _energy;
int _attack;
int _number;
int _getNumber();
void _increaseNumber();
private:
ClapTrap( void ); // default/parametric constructor
static int _totalNumber;
};
#endif