From: Dominik Kaiser Date: Mon, 10 Feb 2025 11:53:16 +0000 (+0100) Subject: Implement HumanA class X-Git-Url: https://git.dkaiser.de/?a=commitdiff_plain;h=57e945f03e37e741a527f07fdcd84307733635e7;p=42%2Fcpp01.git Implement HumanA class --- diff --git a/ex03/HumanA.cpp b/ex03/HumanA.cpp index 38d2076..84dec61 100644 --- a/ex03/HumanA.cpp +++ b/ex03/HumanA.cpp @@ -6,7 +6,19 @@ /* By: dkaiser + +HumanA::HumanA(const std::string &name, Weapon &weapon) + :weapon(&weapon), + name(name) +{} + +void HumanA::attack(void) const +{ + std::cout << name << "attacks with their " << weapon->getType() << std::endl; +} diff --git a/ex03/HumanA.hpp b/ex03/HumanA.hpp index b373665..b127c67 100644 --- a/ex03/HumanA.hpp +++ b/ex03/HumanA.hpp @@ -6,7 +6,7 @@ /* By: dkaiser