ShrubberyCreationForm create file
This commit is contained in:
@@ -73,7 +73,21 @@ void ShrubberyCreationForm::execute(Bureaucrat const &executor)
|
|||||||
throw FormNotSignedException();
|
throw FormNotSignedException();
|
||||||
if (this->getGradeToExecute() < executor.getGrade())
|
if (this->getGradeToExecute() < executor.getGrade())
|
||||||
throw AForm::GradeTooLowException();
|
throw AForm::GradeTooLowException();
|
||||||
// Other things...
|
|
||||||
|
// ShrubberyCreation form action...
|
||||||
|
std::string filename = this->target + "_shrubbery";
|
||||||
|
std::ofstream file(filename.c_str());
|
||||||
|
|
||||||
|
file << " _-_\n";
|
||||||
|
file << " /~~ ~~\\\n";
|
||||||
|
file << " /~~ ~~\\\n";
|
||||||
|
file << "{ }\n";
|
||||||
|
file << " \\ _- -_ /\n";
|
||||||
|
file << " ~ \\ // ~\n";
|
||||||
|
file << "_- - | | _- _\n";
|
||||||
|
file << " _ - | | -_\n";
|
||||||
|
file << " // \\";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
# define SHRUBBERYCREATIONFORM_HPP
|
# define SHRUBBERYCREATIONFORM_HPP
|
||||||
|
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
|
# include <fstream>
|
||||||
# include "../AForm/AForm.hpp"
|
# include "../AForm/AForm.hpp"
|
||||||
|
|
||||||
class ShrubberyCreationForm : public AForm
|
class ShrubberyCreationForm : public AForm
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: hadi <hadi@student.42.fr> +#+ +:+ +#+ */
|
/* By: hadi <hadi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/02/16 22:32:41 by hadi #+# #+# */
|
/* Created: 2026/02/16 22:32:41 by hadi #+# #+# */
|
||||||
/* Updated: 2026/02/17 17:49:09 by hadi ### ########.fr */
|
/* Updated: 2026/02/17 17:53:10 by hadi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -20,7 +20,6 @@ int main()
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Bureaucrat angel("Angel", 137);
|
Bureaucrat angel("Angel", 137);
|
||||||
|
|
||||||
|
|
||||||
angel.executeForm(form);
|
angel.executeForm(form);
|
||||||
angel.signForm(form);
|
angel.signForm(form);
|
||||||
|
|||||||
Reference in New Issue
Block a user