Cure.cpp
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* Cure.cpp :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2023/08/17 22:35:24 by gychoi #+# #+# */ 9 /* Updated: 2023/08/18 00:51:16 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #include "Cure.hpp" 14 #include <iostream> 15 16 /****************************** 17 * Constructor and Destructor * 18 ******************************/ 19 20 Cure::Cure(void) : AMateria("cure") {} 21 22 Cure::~Cure(void) {} 23 24 Cure::Cure(Cure const& target) : AMateria("cure") 25 { 26 if (this != &target) 27 *this = target; 28 } 29 30 Cure& Cure::operator=(Cure const& target) 31 { 32 if (this != &target) 33 AMateria::operator=(target); 34 return *this; 35 } 36 37 /****************************** 38 * Public Member function * 39 ******************************/ 40 41 AMateria* Cure::clone(void) const 42 { 43 return new Cure(); 44 } 45 46 void Cure::use(ICharacter& target) 47 { 48 std::cout << "* heals " << target.getName() << "'s wounds *" << std::endl; 49 }