CPP04 1.0
|
Represents an abstract base class for all magical materias. [詳解]
#include <AMateria.hpp>
公開メンバ関数 | |
AMateria (std::string const &type) | |
Constructs an AMateria object with a specified type. | |
AMateria (const AMateria &other) | |
Copy constructor for AMateria. Performs a shallow copy of the type from another AMateria object. | |
virtual | ~AMateria () |
Destroys the AMateria object. | |
virtual AMateria & | operator= (const AMateria &rhs) |
Copy assignment operator for AMateria. Assigns the type from another AMateria object. Handles self-assignment. | |
std::string const & | getType () const |
Gets the type of the materia. | |
virtual AMateria * | clone () const =0 |
virtual void | use (ICharacter &target) |
Uses the materia on a target character. This is a virtual function with a base implementation that prints a generic use message. Concrete derived classes are expected to override this for specific effects. | |
限定公開変数類 | |
std::string const | type |
Represents an abstract base class for all magical materias.
The AMateria class defines the fundamental properties and behaviors that all types of magic items should possess. It's an abstract class, meaning you can't create an AMateria
object directly. Instead, you create objects of classes that inherit from AMateria
(like Ice
or Cure
).
It enforces a common interface through pure virtual functions like clone()
, ensuring that all concrete materia types know how to duplicate themselves.
AMateria.hpp の 42 行目に定義があります。
AMateria::AMateria | ( | std::string const & | type | ) |
Constructs an AMateria object with a specified type.
type | The string representation of the materia's type. |
AMateria.cpp の 32 行目に定義があります。
AMateria::AMateria | ( | const AMateria & | src | ) |
Copy constructor for AMateria. Performs a shallow copy of the type from another AMateria object.
src | The AMateria object to copy from. |
AMateria.cpp の 43 行目に定義があります。
|
virtual |
Destroys the AMateria object.
AMateria.cpp の 68 行目に定義があります。
std::string const & AMateria::getType | ( | ) | const |
Gets the type of the materia.
AMateria.cpp の 78 行目に定義があります。
|
virtual |
Uses the materia on a target character. This is a virtual function with a base implementation that prints a generic use message. Concrete derived classes are expected to override this for specific effects.
target | The ICharacter object on which the materia is used. |
AMateria.cpp の 86 行目に定義があります。
|
protected |
AMateria.hpp の 44 行目に定義があります。