d05 ex02 ok pour Shrubbery form
This commit is contained in:
@@ -6,13 +6,14 @@
|
||||
* CONSTRUCTORS
|
||||
*********************************************/
|
||||
|
||||
ShrubberyCreationForm::ShrubberyCreationForm( std::string foo = ShrubberyCreationForm::_bar )
|
||||
: _foo(foo) {
|
||||
ShrubberyCreationForm::ShrubberyCreationForm( std::string target )
|
||||
: AForm("shrubbery_creation", target, 145, 137){
|
||||
std::cout << COPLIEN_COLOR "ShrubberyCreationForm constructor" RESET "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
ShrubberyCreationForm::ShrubberyCreationForm( ShrubberyCreationForm const & src ) {
|
||||
ShrubberyCreationForm::ShrubberyCreationForm( ShrubberyCreationForm const & src )
|
||||
: AForm("shrubbery_creation", this->getTarget(), 145, 137) {
|
||||
std::cout << COPLIEN_COLOR "ShrubberyCreationForm copy constructor" RESET "\n";
|
||||
*this = src;
|
||||
return;
|
||||
@@ -32,42 +33,41 @@ ShrubberyCreationForm::~ShrubberyCreationForm() {
|
||||
*********************************************/
|
||||
|
||||
ShrubberyCreationForm & ShrubberyCreationForm::operator=( ShrubberyCreationForm const & rhs ) {
|
||||
// Base::operator=(rhs);
|
||||
if ( this != &rhs )
|
||||
{
|
||||
// _foo = rhs.getFoo();
|
||||
}
|
||||
AForm::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//std::ostream & operator<<(std::ostream & o, ShrubberyCreationForm const & rhs)
|
||||
//{
|
||||
// o << rhs.getFoo();
|
||||
// return (o);
|
||||
//}
|
||||
|
||||
/*********************************************
|
||||
* ACCESSORS
|
||||
*********************************************/
|
||||
|
||||
//std::string ShrubberyCreationForm::getFoo() const {return _foo;}
|
||||
|
||||
/*********************************************
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*********************************************/
|
||||
|
||||
//void ShrubberyCreationForm::function(const std::string & foo) {}
|
||||
void ShrubberyCreationForm::formAction() const {
|
||||
std::ofstream ofs("Shrubbery.txt", std::ofstream::out);
|
||||
|
||||
/*********************************************
|
||||
* NESTED CLASS
|
||||
*********************************************/
|
||||
if (!ofs)
|
||||
{
|
||||
std::cout << "opening Shrubbery.txt file failed\n";
|
||||
return ;
|
||||
}
|
||||
|
||||
//void ShrubberyCreationForm::Class::function() {}
|
||||
|
||||
/*********************************************
|
||||
* STATICS
|
||||
*********************************************/
|
||||
|
||||
//std::string const ShrubberyCreationForm::_bar = "bar";
|
||||
ofs << " * *\n";
|
||||
ofs << " * * *\n";
|
||||
ofs << " * * * * *\n";
|
||||
ofs << " * * * * *\n";
|
||||
ofs << " * * * * * * *\n";
|
||||
ofs << " * * * * * .# * *\n";
|
||||
ofs << " * * * #. .# * *\n";
|
||||
ofs << " * \"#. #: #\" * * *\n";
|
||||
ofs << " * * * \"#. ##\" *\n";
|
||||
ofs << " * \"###\n";
|
||||
ofs << " \"##\n";
|
||||
ofs << " ##.\n";
|
||||
ofs << " .##:\n";
|
||||
ofs << " :###\n";
|
||||
ofs << " ;###\n";
|
||||
ofs << " ,####.\n";
|
||||
ofs << " /\\/\\/\\/\\/\\/.######.\\/\\/\\/\\/\\\n";
|
||||
|
||||
ofs.close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user