CPP01/ex03/src/HumanB.cpp
2025-03-21 16:59:41 +01:00

36 lines
1.2 KiB
C++

/* ************************************************************************** */
/* */
/* :::::::: */
/* HumanB.cpp :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/03/21 16:49:44 by whaffman #+# #+# */
/* Updated: 2025/03/21 16:54:09 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#include <string>
#include <iostream>
#include "Weapon.hpp"
#include "HumanB.hpp"
HumanB::HumanB(std::string p_name)
{
name = p_name;
weapon = nullptr;
}
void HumanB::attack()
{
std::cout << name << " attacks with " << (*weapon).getType() << std::endl;
}
void HumanB::setWeapon(Weapon &p_weapon)
{
weapon = &p_weapon;
}