| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* RobotomyRequestForm.cpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2025/12/30 15:05:32 by bchanot #+# #+# */
- /* Updated: 2025/12/30 17:51:31 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "RobotomyRequestForm.hpp"
- #include <cstdlib>
- #include <ctime>
- /*
- ** ------------------------------- 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 )
- {
- (void)i;
- //o << "Value = " << i.getValue();
- 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 ---------------------------------
- */
- /* ************************************************************************** */
|