feat(ex03): it works
This commit is contained in:
parent
8f7b9c3068
commit
28784b50f0
9 changed files with 153 additions and 0 deletions
26
ex03/main.cpp
Normal file
26
ex03/main.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#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();
|
||||
}
|
||||
{
|
||||
HumanB john("John");
|
||||
john.attack();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue