46 lines
1.6 KiB
C++
46 lines
1.6 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.cpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/04/20 16:48:48 by erey-bet #+# #+# */
|
|
/* Updated: 2023/04/20 17:14:36 by erey-bet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "Weapon.hpp"
|
|
#include "HumanA.hpp"
|
|
#include "HumanB.hpp"
|
|
|
|
int main()
|
|
{
|
|
{
|
|
Weapon club = Weapon("crude spiked club");
|
|
HumanA bob("Bob", club);
|
|
bob.attack();
|
|
club.setType("some other type of club");
|
|
bob.attack();
|
|
}
|
|
std::cout << "------------------------------" << std::endl;
|
|
{
|
|
Weapon club = Weapon("crude spiked club");
|
|
HumanB jim("Jim");
|
|
jim.attack();
|
|
jim.setWeapon(club);
|
|
jim.attack();
|
|
club.setType("some other type of club");
|
|
jim.attack();
|
|
}
|
|
std::cout << "------------------------------" << std::endl;
|
|
{
|
|
Weapon sword = Weapon("strange sword");
|
|
HumanB jim("Timeo", sword);
|
|
jim.attack();
|
|
sword.setType("other strange sword");
|
|
jim.attack();
|
|
}
|
|
return 0;
|
|
}
|