debut d01 ex03
This commit is contained in:
23
d01/ex03/main.cpp
Normal file
23
d01/ex03/main.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user