Cure.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* Cure.cpp :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2025/12/19 15:29:40 by bchanot #+# #+# */
  9. /* Updated: 2025/12/19 16:20:46 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "Cure.hpp"
  13. /*
  14. ** ------------------------------- CONSTRUCTOR --------------------------------
  15. */
  16. Cure::Cure() : AMateria("ice")
  17. {
  18. std::cout << "ice AMateria construct" << std::endl;
  19. }
  20. Cure::Cure( const Cure & src ) : AMateria(src._type)
  21. {
  22. std::cout << "ice AMateria construct" << std::endl;
  23. }
  24. /*
  25. ** -------------------------------- DESTRUCTOR --------------------------------
  26. */
  27. Cure::~Cure()
  28. {
  29. std::cout << "ice AMateria destructed" << std::endl;
  30. }
  31. /*
  32. ** --------------------------------- OVERLOAD ---------------------------------
  33. */
  34. std::ostream & operator<<( std::ostream & o, Cure const & i )
  35. {
  36. o << "Type = " << i.getType();
  37. return o;
  38. }
  39. /*
  40. ** --------------------------------- METHODS ----------------------------------
  41. */
  42. AMateria* Cure::clone() const {
  43. return (new Cure(*this));
  44. }
  45. void Cure::use(ICharacter& target) {
  46. std::cout << "* heals " << target << "'s wounds *" << std::endl;
  47. }
  48. /*
  49. ** --------------------------------- ACCESSOR ---------------------------------
  50. */
  51. /* ************************************************************************** */