1
0
This repository has been archived on 2025-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
CPP_Module_04/ex03/Cure.cpp
2024-12-10 15:22:18 +01:00

47 lines
1.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Cure.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/10 12:34:54 by adjoly #+# #+# */
/* Updated: 2024/12/10 13:47:54 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "Cure.hpp"
#include "AMateria.hpp"
#include "ICharacter.hpp"
#include "Log.hpp"
#include <iostream>
Cure::Cure(void) : AMateria("cure") {
log("", "Cure", "", "default constructor called");
}
Cure::Cure(const Cure &cpy) {
log("", "Cure", "", "copy constructor called");
*this = cpy;
}
Cure::~Cure(void) {
log("", "Cure", "", "destructor called");
}
Cure &Cure::operator=(const Cure &cpy) {
log("", "Cure", "", "copy assignement constructor called");
if (this != &cpy) {
_type = cpy._type;
}
return (*this);
}
Cure *Cure::clone(void) const {
return (new Cure);
}
void Cure::use(ICharacter &character) {
std::cout << "* heals " << character.getName() << "s wounds *";
}