「✨」 feat: finished ex03
This commit is contained in:
62
ex03/main.cpp
Normal file
62
ex03/main.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* main.cpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/12/23 14:01:11 by adjoly #+# #+# */
|
||||
/* Updated: 2025/04/03 15:51:43 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "Bureaucrat.hpp"
|
||||
#include "AForm.hpp"
|
||||
#include "Intern.hpp"
|
||||
#include "ShrubberyCreationForm.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int main(void) {
|
||||
Bureaucrat knl("Kanel", 10);
|
||||
|
||||
knl--;
|
||||
std::cout << knl << std::endl;
|
||||
knl++;
|
||||
std::cout << knl << std::endl;
|
||||
try {
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
knl++;
|
||||
} catch (const std::exception &e) {
|
||||
std::cerr << "Error : " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
Intern intern;
|
||||
|
||||
AForm *s;
|
||||
|
||||
s = intern.makeForm("robotomy request", "Kanel");
|
||||
|
||||
try {
|
||||
s->beSigned(knl);
|
||||
knl.executeForm(*s);
|
||||
} catch (std::exception &e) {
|
||||
std::cerr << "Error : " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
std::cout << knl << std::endl;
|
||||
}
|
Reference in New Issue
Block a user