42_CPP01/ex03/src/Weapon.cpp
2023-07-18 03:20:06 +02:00

41 lines
547 B
C++

#include "Weapon.hpp"
#include <iostream>
#include <string>
Weapon::Weapon()
{
std::cout << "Weapon()" << std::endl;
}
Weapon::Weapon(const Weapon& src)
{
this->_type = src._type;
}
Weapon::Weapon(const std::string& type)
{
this->_type = type;
}
Weapon::~Weapon()
{
std::cout << "Weapon()" << std::endl;
}
Weapon& Weapon::operator=(const Weapon &src)
{
this->_type = src._type;
return *this;
}
void Weapon::setType(const std::string& newType)
{
this->_type = newType;
}
const std::string& Weapon::getType()
{
return this->_type;
}