debut d01 ex03

This commit is contained in:
hugogogo
2022-02-05 19:14:56 +01:00
parent e6929e8e12
commit c1990815e2
11 changed files with 306 additions and 0 deletions

23
d01/ex03/main.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include "HumanA.hpp"
#include "HumanB.hpp"
#include "Weapon.hpp"
int main()
{
{
Weapon club = Weapon("crude spiked club");
HumanA bob("Bob", club);
bob.attack();
club.setType("some other type of club");
bob.attack();
}
{
Weapon club = Weapon("crude spiked club");
HumanB jim("Jim");
jim.setWeapon(club);
jim.attack();
club.setType("some other type of club");
jim.attack();
}
return 0;
}