main.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* main.cpp :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@gmail.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2025/07/15 16:42:34 by bchanot #+# #+# */
  9. /* Updated: 2025/07/15 16:43:49 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "HumanA.class.hpp"
  13. #include "HumanB.class.hpp"
  14. #include "Weapon.class.hpp"
  15. int main()
  16. {
  17. {
  18. Weapon club = Weapon("crude spiked club");
  19. HumanA bob("Bob", club);
  20. bob.attack();
  21. club.setType("some other type of club");
  22. bob.attack();
  23. }
  24. {
  25. Weapon club = Weapon("crude spiked club");
  26. HumanB jim("Jim");
  27. jim.setWeapon(club);
  28. jim.attack();
  29. club.setType("some other type of club");
  30. jim.attack();
  31. }
  32. return 0;
  33. }