CPP05 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
RobotomyRequestForm.cpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* RobotomyRequestForm.cpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/06/30 12:42:12 by kamitsui #+# #+# */
9/* Updated: 2025/06/30 12:42:20 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
19
20RobotomyRequestForm::RobotomyRequestForm(const std::string &target) : AForm("Robotomy Request", 72, 45, target) {}
21
22RobotomyRequestForm::RobotomyRequestForm(const RobotomyRequestForm &other) : AForm(other) {}
23
25 AForm::operator=(other);
26 return *this;
27}
28
30
32 std::cout << "* VRRR... BZZZZT... CLANK! *" << std::endl;
33 if (rand() % 2) {
34 std::cout << getTarget() << " has been successfully robotomized!" << std::endl;
35 } else {
36 std::cout << "The robotomy on " << getTarget() << " has failed." << std::endl;
37 }
38}
An abstract base class for forms.
Definition AForm.hpp:34
const std::string & getTarget() const
Definition AForm.cpp:46
AForm & operator=(const AForm &other)
Definition AForm.cpp:32
A concrete form that simulates a robotomy attempt.
RobotomyRequestForm & operator=(const RobotomyRequestForm &other)
virtual void performAction() const
Makes drilling noises and informs of a 50% successful robotomy.
T endl(T... args)
Defines the RobotomyRequestForm class.
T rand(T... args)