/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* RobotomyRequestForm.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/12/30 15:05:32 by bchanot #+# #+# */ /* Updated: 2025/12/31 16:05:19 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "RobotomyRequestForm.hpp" #include #include /* ** ------------------------------- CONSTRUCTOR -------------------------------- */ RobotomyRequestForm::RobotomyRequestForm() : AForm("RobotomyRequestForm", 45, 72, "DefaultTarget") { } RobotomyRequestForm::RobotomyRequestForm( const std::string & target ) : AForm("RobotomyRequestForm", 45, 72, target) { } RobotomyRequestForm::RobotomyRequestForm( const RobotomyRequestForm & src ) : AForm(src.getName(), src.getSignGrade(), src.getExecutionGrade(), src._target) { } /* ** -------------------------------- DESTRUCTOR -------------------------------- */ RobotomyRequestForm::~RobotomyRequestForm() { } /* ** --------------------------------- OVERLOAD --------------------------------- */ RobotomyRequestForm & RobotomyRequestForm::operator=( RobotomyRequestForm const & rhs ) { (void)rhs; //if ( this != &rhs ) //{ //this->_value = rhs.getValue(); //} return *this; } std::ostream & operator<<( std::ostream & o, RobotomyRequestForm const & i ) { i.print(o); return o; } /* ** --------------------------------- METHODS ---------------------------------- */ void RobotomyRequestForm::action(void) const { srand(time(0)); if (rand() % 2) std::cout << "*biiip bup biip, dzz dzzzzz* " << this->_target << " has been robotized successfully" << std::endl; else std::cout << "Oh.. Robotizing " << this->_target << " failed ... try again" << std::endl; } /* ** --------------------------------- ACCESSOR --------------------------------- */ /* ************************************************************************** */