「🎉」 init: hello world !
This commit is contained in:
42
ex02/RobotomyRequestForm.cpp
Normal file
42
ex02/RobotomyRequestForm.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user