feat: finishing the exercice 02 & 03 from the module 01

This commit is contained in:
Raphael 2024-11-05 14:50:42 +01:00
parent a6ec8890cf
commit 2b197d8d05
11 changed files with 364 additions and 68 deletions

29
cpp01/ex03/HumanA.cpp Normal file
View file

@ -0,0 +1,29 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* HumanA.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/05 13:34:23 by rparodi #+# #+# */
/* Updated: 2024/11/05 14:29:33 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "HumanA.hpp"
HumanA::HumanA(std::string name, Weapon &toGive)
{
_name = name;
_weapon = &toGive;
}
HumanA::~HumanA()
{
}
void HumanA::attack()
{
std::cout << CLR_GOLD << _name << CLR_YELLOW << " attacks with their " << CLR_GOLD << _weapon->getType() << CLR_RESET << std::endl;
}