CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
AMateria クラスabstract

Represents an abstract base class for all magical materias. [詳解]

#include <AMateria.hpp>

AMateria の継承関係図
Inheritance graph
AMateria 連携図
Collaboration graph

公開メンバ関数

 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 AMateriaoperator= (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 AMateriaclone () 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.hpp42 行目に定義があります。

構築子と解体子

◆ AMateria() [1/2]

AMateria::AMateria ( std::string const &  type)

Constructs an AMateria object with a specified type.

引数
typeThe string representation of the materia's type.

AMateria.cpp32 行目に定義があります。

◆ AMateria() [2/2]

AMateria::AMateria ( const AMateria src)

Copy constructor for AMateria. Performs a shallow copy of the type from another AMateria object.

引数
srcThe AMateria object to copy from.

AMateria.cpp43 行目に定義があります。

◆ ~AMateria()

AMateria::~AMateria ( )
virtual

Destroys the AMateria object.

AMateria.cpp68 行目に定義があります。

関数詳解

◆ clone()

virtual AMateria * AMateria::clone ( ) const
pure virtual

Cure, Iceで実装されています。

◆ getType()

std::string const & AMateria::getType ( ) const

Gets the type of the materia.

戻り値
A constant reference to the materia's type string.

AMateria.cpp78 行目に定義があります。

◆ operator=()

AMateria & AMateria::operator= ( const AMateria rhs)
virtual

Copy assignment operator for AMateria. Assigns the type from another AMateria object. Handles self-assignment.

引数
rhsThe AMateria object to assign from.
戻り値
A reference to the assigned AMateria object.

AMateria.cpp55 行目に定義があります。

◆ use()

void AMateria::use ( ICharacter target)
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.

引数
targetThe ICharacter object on which the materia is used.

Cure, Iceで再実装されています。

AMateria.cpp86 行目に定義があります。

メンバ詳解

◆ type

std::string const AMateria::type
protected

AMateria.hpp44 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: