Ice.cpp
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* Ice.cpp :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2023/08/17 22:18:39 by gychoi #+# #+# */ 9 /* Updated: 2023/08/18 00:51:20 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #include "Ice.hpp" 14 #include <iostream> 15 16 /****************************** 17 * Constructor and Destructor * 18 ******************************/ 19 20 Ice::Ice(void) : AMateria("ice") {} 21 22 Ice::~Ice(void) {} 23 24 Ice::Ice(Ice const& target) : AMateria("ice") 25 { 26 if (this != &target) 27 *this = target; 28 } 29 30 Ice& Ice::operator=(Ice 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* Ice::clone(void) const 42 { 43 return new Ice(); 44 } 45 46 void Ice::use(ICharacter& target) 47 { 48 std::cout << "* shoots an ice bolt at " << target.getName() << " *" << std::endl; 49 }