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:21:11 by kamitsui #+# #+# */
9/* Updated: 2025/07/18 02:47:36 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
28
30
35 std::cout << "* VRRR... BZZZZT... CLANK! *" << std::endl;
36 if (std::rand() % 2) {
37 std::cout << getTarget() << " has been successfully robotomized!" << std::endl;
38 } else {
39 std::cout << "The robotomy on " << getTarget() << " has failed." << std::endl;
40 }
41}
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)