This commit is contained in:
Ladebeze66
2024-03-11 15:15:36 +01:00
parent bc0c76ac99
commit ed40c42452
19 changed files with 85 additions and 52 deletions

View File

@@ -6,13 +6,18 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/11 14:39:51 by fgras-ca #+# #+# */
/* Updated: 2024/02/22 14:36:36 by fgras-ca ### ########.fr */
/* Updated: 2024/03/11 15:11:19 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include "Bureaucrat.hpp"
#include "AForm.hpp"
AForm::AForm() : name("default"), isSigned(false), gradeRequiredToSign(150), gradeRequiredToExecute(150)
{
std::cout << GREEN << "AForm default constructor called!" << RESET << std::endl;
}
AForm::AForm(const std::string &name, int gradeRequiredToSign, int gradeRequiredToExecute)
: name(name), isSigned(false), gradeRequiredToSign(gradeRequiredToSign), gradeRequiredToExecute(gradeRequiredToExecute)
{
@@ -24,6 +29,7 @@ AForm::AForm(const std::string &name, int gradeRequiredToSign, int gradeRequired
{
throw GradeTooLowException();
}
std::cout << GREEN << "AForm" << this->name << "constructor called with grade to sign: " << this->gradeRequiredToSign << " and grade to execute: " << this->gradeRequiredToExecute << RESET << std::endl;
}
AForm::AForm(const AForm& other)

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/11 14:37:14 by fgras-ca #+# #+# */
/* Updated: 2024/02/22 13:49:48 by fgras-ca ### ########.fr */
/* Updated: 2024/03/11 14:54:08 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -32,6 +32,7 @@ protected:
public:
//constructueur
AForm();
AForm(const std::string &name, int gradeRequiredToSign, int gradeRequiredToExecute);
// Constructeur par copie
AForm(const AForm& other);

View File

@@ -6,12 +6,17 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/21 11:31:13 by fgras-ca #+# #+# */
/* Updated: 2024/02/25 13:29:09 by fgras-ca ### ########.fr */
/* Updated: 2024/03/11 15:15:01 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include "PresidentialPardonForm.hpp"
PresidentialPardonForm::PresidentialPardonForm()
{
std::cout << GREEN << "PresidentialPardonForm default constructor called!" << RESET << std::endl;
}
PresidentialPardonForm::PresidentialPardonForm(const std::string& target)
: AForm("PresidentialPardonForm", 25, 5), target(target)
{

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/20 16:56:48 by fgras-ca #+# #+# */
/* Updated: 2024/02/22 15:39:59 by fgras-ca ### ########.fr */
/* Updated: 2024/03/11 15:07:10 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,6 +28,7 @@ private:
std::string target;
public:
PresidentialPardonForm();
PresidentialPardonForm(const std::string& target);
PresidentialPardonForm(const PresidentialPardonForm& other);
PresidentialPardonForm& operator=(const PresidentialPardonForm& other);

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/21 11:25:21 by fgras-ca #+# #+# */
/* Updated: 2024/02/25 13:15:16 by fgras-ca ### ########.fr */
/* Updated: 2024/03/11 15:03:42 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -22,6 +22,11 @@ void RobotomyRequestForm::initializeRandomSeed()
}
}
RobotomyRequestForm::RobotomyRequestForm()
{
std::cout << GREEN << "RobotomyRequestForm default constructor called!" << RESET << std::endl;
}
RobotomyRequestForm::RobotomyRequestForm(const std::string& target)
: AForm("RobotomyRequestForm", 72, 45), target(target)
{

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/20 16:55:26 by fgras-ca #+# #+# */
/* Updated: 2024/02/22 16:10:22 by fgras-ca ### ########.fr */
/* Updated: 2024/03/11 15:06:32 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -30,6 +30,7 @@ private:
std::string target;
public:
RobotomyRequestForm();
RobotomyRequestForm(const std::string& target);
RobotomyRequestForm(const RobotomyRequestForm& other);
RobotomyRequestForm& operator=(const RobotomyRequestForm& other);

View File

@@ -6,12 +6,17 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/20 16:54:52 by fgras-ca #+# #+# */
/* Updated: 2024/02/22 16:33:23 by fgras-ca ### ########.fr */
/* Updated: 2024/03/11 15:05:29 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include "ShrubberyCreationForm.hpp"
ShrubberyCreationForm::ShrubberyCreationForm()
{
std::cout << GREEN << "ShrubberyCreationForm default constructor called!" << RESET << std::endl;
}
ShrubberyCreationForm::ShrubberyCreationForm(const std::string& target)
: AForm("ShrubberyCreationForm", 145, 137), target(target)
{

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/20 16:41:49 by fgras-ca #+# #+# */
/* Updated: 2024/02/22 15:35:33 by fgras-ca ### ########.fr */
/* Updated: 2024/03/11 15:04:32 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,6 +28,7 @@ private:
std::string target;
public:
ShrubberyCreationForm();
ShrubberyCreationForm(const std::string& target);
ShrubberyCreationForm(const ShrubberyCreationForm& other);
ShrubberyCreationForm& operator=(const ShrubberyCreationForm& other);