43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#include "RobotomyRequestForm.hpp"
|
||
#include "Bureaucrat.hpp"
|
||
#include <cstdlib>
|
||
|
||
RobotomyRequestForm::RobotomyRequestForm(void): AForm("RobotomyRequestForm", 72, 45) {
|
||
_log("➕", "RobotomyRequestForm", "", "default constructor called");
|
||
std::srand(time(0));
|
||
}
|
||
|
||
RobotomyRequestForm::RobotomyRequestForm(const RobotomyRequestForm &cpy) : AForm(cpy) {
|
||
_log("➕", "RobotomyRequestForm", "", "copy constructor called");
|
||
std::srand(time(0));
|
||
if (this != &cpy)
|
||
*this = cpy;
|
||
}
|
||
|
||
RobotomyRequestForm::RobotomyRequestForm(std::string target): AForm(target, 72, 45) {
|
||
_log("➕", "RobotomyRequestForm", "", "target constructor called");
|
||
std::srand(time(0));
|
||
}
|
||
|
||
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 {
|
||
(void) b;
|
||
std::cout << "Driling noise or smth idk" << std::endl;
|
||
|
||
if (std::rand() % 2) {
|
||
std::cout << this->getName() << " has been robotomised successfully ! :D" << std::endl;
|
||
} else {
|
||
std::cout << this->getName() << " robotomisation failed D:" << std::endl;
|
||
}
|
||
}
|
||
|