save work of day d03 ex03 l'ordi plante

This commit is contained in:
Hugo LAMY
2022-02-22 22:18:43 +01:00
parent 8c9d50dd68
commit b24335a78e
12 changed files with 278 additions and 159 deletions

View File

@@ -4,13 +4,12 @@
#include <iostream>
#include <sstream>
#include <string>
#include <color.h>
class ClapTrap {
public:
ClapTrap( std::string name ); // default/parametric constructor
ClapTrap( std::string name = ClapTrap::_dName );
ClapTrap( ClapTrap const & src ); // copy constructor
~ClapTrap( void ); // destructor
@@ -21,28 +20,37 @@ public:
void beRepaired(unsigned int amount);
std::string getName() const;
std::string getClass() const;
int getHit() const;
int getEnergy() const;
int getAttack() const;
int getNumber() const;
protected:
std::string const _name;
std::string _class;
int _hit;
int _energy;
int _attack;
int _number;
int getTotalNumber() const;
std::string _name;
std::string _class;
int _hit;
int _energy;
int _attack;
int _number;
int _getNumber();
void _increaseNumber();
private:
ClapTrap( void ); // default/parametric constructor
void assignValues(ClapTrap & src);
static int _totalNumber;
static const std::string _dName;
static const std::string _dClass;
static const int _dHit;
static const int _dEnergy;
static const int _dAttack;
static const int _dNumber;
};
#endif