Files
cpp05/ex03/main.cpp

45 lines
1.6 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/21 12:14:52 by aortigos #+# #+# */
/* Updated: 2026/02/21 12:46:24 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "Bureaucrat/Bureaucrat.hpp"
#include "AForm/AForm.hpp"
#include "Intern/Intern.hpp"
#include "ShrubberyCreationForm/ShrubberyCreationForm.hpp"
#include "RobotomyRequestForm/RobotomyRequestForm.hpp"
#include "PresidentialPardonForm/PresidentialPardonForm.hpp"
int main()
{
// Inicilizamos semilla de rand, necesario para
// RobotomyRequestForm
srand(time(NULL));
std::cout << "---- ex03 tests ----" << std::endl;
Bureaucrat angel("Angel", 1);
Intern intern;
try {
AForm* form = intern.makeForm("presidential pardon", "home");
angel.executeForm(*form);
angel.signForm(*form);
angel.executeForm(*form);
delete form;
} catch (std::exception &e) {
std::cout << e.what() << std::endl;
}
std::cout << std::endl;
return (0);
}