CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Cure.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* Cure.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/05/29 23:49:24 by kamitsui #+# #+# */
9/* Updated: 2025/05/29 23:49:25 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
23#ifndef CURE_HPP
24#define CURE_HPP
25
26#include "AMateria.hpp" // Inherits from AMateria
27
36class Cure : public AMateria {
37 public:
38 Cure();
39 Cure(const Cure &other);
40 Cure &operator=(const Cure &other);
41 virtual ~Cure();
42
43 virtual AMateria *clone() const;
44 virtual void use(ICharacter &target);
45};
46
47#endif
Declares the AMateria abstract base class.
Represents an abstract base class for all magical materias.
Definition AMateria.hpp:42
Represents a healing magic materia.
Definition Cure.hpp:36
Cure & operator=(const Cure &other)
Copy assignment operator for Cure. Assigns values from another Cure object by calling the base class ...
Definition Cure.cpp:45
virtual void use(ICharacter &target)
Uses the Cure materia to heal the target character. Prints a message indicating that the target's wou...
Definition Cure.cpp:67
virtual ~Cure()
Destroys the Cure object.
Definition Cure.cpp:54
Cure()
Default constructor for Cure. Initializes the materia type to "cure".
Definition Cure.cpp:29
virtual AMateria * clone() const
Creates a new, identical instance of a Cure materia.
Definition Cure.cpp:60
An interface for any character that can interact with Materias.