Cure.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/26 01:48:42 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "Cure.hpp"
  13. /*
  14. ** ------------------------------- CONSTRUCTOR --------------------------------
  15. */
  16. Cure::Cure() : AMateria("cure")
  17. {
  18. }
  19. Cure::Cure( const Cure & src ) : AMateria(src._type)
  20. {
  21. }
  22. /*
  23. ** -------------------------------- DESTRUCTOR --------------------------------
  24. */
  25. Cure::~Cure()
  26. {
  27. }
  28. /*
  29. ** --------------------------------- OVERLOAD ---------------------------------
  30. */
  31. std::ostream & operator<<( std::ostream & o, Cure const & i )
  32. {
  33. o << "Type = " << i.getType();
  34. return o;
  35. }
  36. /*
  37. ** --------------------------------- METHODS ----------------------------------
  38. */
  39. AMateria* Cure::clone() const {
  40. return (new Cure(*this));
  41. }
  42. void Cure::use(ICharacter& target) {
  43. std::cout << "* heals " << target.getName() << "'s wounds *" << std::endl;
  44. }
  45. /*
  46. ** --------------------------------- ACCESSOR ---------------------------------
  47. */
  48. /* ************************************************************************** */