/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* PresidentialPardonForm.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: aortigos target = other.getTarget(); } //std::cout << "AForm copy assigment operator called" << std::endl; return (*this); } PresidentialPardonForm::~PresidentialPardonForm() { //std::cout << "Destructor called" } PresidentialPardonForm::PresidentialPardonForm(std::string target) : AForm("PresidentialPardonForm", 25, 5), target(target) { //std::cout << "AForm constructor with params called" << std::endl; } ////////////////// // Getters // ////////////////// std::string PresidentialPardonForm::getTarget() const { return (this->target); } ////////////////// // Execute // ////////////////// void PresidentialPardonForm::execute(Bureaucrat const &executor) const { if (!this->getIsSigned()) throw FormNotSignedException(); if (this->getGradeToExecute() < executor.getGrade()) throw AForm::GradeTooLowException(); // PresidentialPardonForm form action... std::cout << this->target << " has been pardoned by Zaphod Beeblebrox." << std::endl; } ////////////////// // Exceptions // ////////////////// const char* PresidentialPardonForm::FormNotSignedException::what() const throw() { return ("form is not signed."); }