RobotomyRequestForm.cpp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* RobotomyRequestForm.cpp :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2025/12/30 15:05:32 by bchanot #+# #+# */
  9. /* Updated: 2025/12/30 17:51:31 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "RobotomyRequestForm.hpp"
  13. #include <cstdlib>
  14. #include <ctime>
  15. /*
  16. ** ------------------------------- CONSTRUCTOR --------------------------------
  17. */
  18. RobotomyRequestForm::RobotomyRequestForm() : AForm("RobotomyRequestForm", 45, 72, "DefaultTarget")
  19. {
  20. }
  21. RobotomyRequestForm::RobotomyRequestForm( const std::string & target ) : AForm("RobotomyRequestForm", 45, 72, target)
  22. {
  23. }
  24. RobotomyRequestForm::RobotomyRequestForm( const RobotomyRequestForm & src ) : AForm(src.getName(), src.getSignGrade(), src.getExecutionGrade(), src._target)
  25. {
  26. }
  27. /*
  28. ** -------------------------------- DESTRUCTOR --------------------------------
  29. */
  30. RobotomyRequestForm::~RobotomyRequestForm()
  31. {
  32. }
  33. /*
  34. ** --------------------------------- OVERLOAD ---------------------------------
  35. */
  36. RobotomyRequestForm & RobotomyRequestForm::operator=( RobotomyRequestForm const & rhs )
  37. {
  38. (void)rhs;
  39. //if ( this != &rhs )
  40. //{
  41. //this->_value = rhs.getValue();
  42. //}
  43. return *this;
  44. }
  45. std::ostream & operator<<( std::ostream & o, RobotomyRequestForm const & i )
  46. {
  47. (void)i;
  48. //o << "Value = " << i.getValue();
  49. return o;
  50. }
  51. /*
  52. ** --------------------------------- METHODS ----------------------------------
  53. */
  54. void RobotomyRequestForm::action(void) const {
  55. srand(time(0));
  56. if (rand() % 2)
  57. std::cout << "*biiip bup biip, dzz dzzzzz* " << this->_target << " has been robotized successfully" << std::endl;
  58. else
  59. std::cout << "Oh.. Robotizing " << this->_target << " failed ... try again" << std::endl;
  60. }
  61. /*
  62. ** --------------------------------- ACCESSOR ---------------------------------
  63. */
  64. /* ************************************************************************** */