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

An interface for any character that can interact with Materias. [詳解]

#include <ICharacter.hpp>

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

公開メンバ関数

virtual ~ICharacter ()
 Virtual destructor for the ICharacter interface. Ensures proper cleanup of derived class objects when deleted through an ICharacter pointer. It has an empty implementation here as it's an interface.
 
virtual std::string const & getName () const =0
 Gets the name of the character. This is a pure virtual function, requiring derived classes to implement it.
 
virtual void equip (AMateria *m)=0
 Equips a Materia to the character's inventory. This is a pure virtual function, requiring derived classes to implement it.
 
virtual void unequip (int idx)=0
 Unequips a Materia from a specific inventory slot. This is a pure virtual function, requiring derived classes to implement it. The unequipped Materia's memory is NOT managed by this method.
 
virtual void use (int idx, ICharacter &target)=0
 Uses the Materia at a specific inventory slot on a target character. This is a pure virtual function, requiring derived classes to implement it.
 
virtual AMateriagetMateriaAtSlot (int idx) const =0
 

詳解

An interface for any character that can interact with Materias.

The ICharacter interface is a pure abstract class, meaning it cannot be instantiated directly. Its sole purpose is to define a contract for classes that represent characters in the game world. Any class implementing ICharacter must provide concrete implementations for all its pure virtual methods, ensuring a consistent way to handle characters in a polymorphic manner.

ICharacter.hpp46 行目に定義があります。

構築子と解体子

◆ ~ICharacter()

virtual ICharacter::~ICharacter ( )
inlinevirtual

Virtual destructor for the ICharacter interface. Ensures proper cleanup of derived class objects when deleted through an ICharacter pointer. It has an empty implementation here as it's an interface.

ICharacter.hpp53 行目に定義があります。

関数詳解

◆ equip()

virtual void ICharacter::equip ( AMateria m)
pure virtual

Equips a Materia to the character's inventory. This is a pure virtual function, requiring derived classes to implement it.

引数
mA pointer to the AMateria object to be equipped.

Characterで実装されています。

◆ getMateriaAtSlot()

virtual AMateria * ICharacter::getMateriaAtSlot ( int  idx) const
pure virtual

Characterで実装されています。

◆ getName()

virtual std::string const & ICharacter::getName ( ) const
pure virtual

Gets the name of the character. This is a pure virtual function, requiring derived classes to implement it.

戻り値
A constant reference to the character's name string.

Characterで実装されています。

◆ unequip()

virtual void ICharacter::unequip ( int  idx)
pure virtual

Unequips a Materia from a specific inventory slot. This is a pure virtual function, requiring derived classes to implement it. The unequipped Materia's memory is NOT managed by this method.

引数
idxThe index of the inventory slot to unequip from.

Characterで実装されています。

◆ use()

virtual void ICharacter::use ( int  idx,
ICharacter target 
)
pure virtual

Uses the Materia at a specific inventory slot on a target character. This is a pure virtual function, requiring derived classes to implement it.

引数
idxThe index of the inventory slot containing the Materia to use.
targetThe ICharacter object on which the Materia will be used.

Characterで実装されています。


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