54 lines
2.1 KiB
C++
54 lines
2.1 KiB
C++
/* ************************************************************************** */
|
||
/* */
|
||
/* ::: :::::::: */
|
||
/* RobotomyRequestForm.cpp :+: :+: :+: */
|
||
/* +:+ +:+ +:+ */
|
||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||
/* +#+#+#+#+#+ +#+ */
|
||
/* Created: 2025/04/03 09:19:30 by adjoly #+# #+# */
|
||
/* Updated: 2025/04/03 16:02:35 by adjoly ### ########.fr */
|
||
/* */
|
||
/* ************************************************************************** */
|
||
|
||
#include "RobotomyRequestForm.hpp"
|
||
#include "Bureaucrat.hpp"
|
||
#include <cstdlib>
|
||
|
||
RobotomyRequestForm::RobotomyRequestForm(void)
|
||
: AForm("RobotomyRequestForm", 72, 45) {
|
||
_log("➕", "RobotomyRequestForm", "", "default constructor called");
|
||
}
|
||
|
||
RobotomyRequestForm::RobotomyRequestForm(const RobotomyRequestForm &cpy) : AForm(cpy) {
|
||
_log("➕", "RobotomyRequestForm", "", "copy constructor called");
|
||
if (this != &cpy)
|
||
*this = cpy;
|
||
}
|
||
|
||
RobotomyRequestForm::RobotomyRequestForm(std::string &target)
|
||
: AForm(target, 72, 45) {
|
||
_log("➕", "RobotomyRequestForm", "", "target constructor called");
|
||
}
|
||
|
||
RobotomyRequestForm::~RobotomyRequestForm(void) {
|
||
_log("➖", "RobotomyRequestForm", "", "destructor called");
|
||
}
|
||
|
||
RobotomyRequestForm &RobotomyRequestForm::operator=(const RobotomyRequestForm &cpy) {
|
||
_log("➕", "RobotomyRequestForm", "", "copy assignement constructor called");
|
||
(void)cpy;
|
||
return *this;
|
||
}
|
||
|
||
void RobotomyRequestForm::_exec(const Bureaucrat &b) const {
|
||
std::cout << "Drilingg noisseeeeeeee !!!" << std::endl;
|
||
|
||
std::srand(time(0));
|
||
|
||
if (std::rand() % 2) {
|
||
std::cout << b.getName() << " has been robotomised successfully ! :D" << std::endl;
|
||
} else {
|
||
std::cout << b.getName() << " robotomisation failed 😿" << std::endl;
|
||
}
|
||
}
|