CPP04 1.0
|
An interface for any character that can interact with Materias. [詳解]
#include <ICharacter.hpp>
公開メンバ関数 | |
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 AMateria * | getMateriaAtSlot (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.hpp の 46 行目に定義があります。
|
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.hpp の 53 行目に定義があります。
|
pure virtual |
|
pure virtual |
Gets the name of the character. This is a pure virtual function, requiring derived classes to implement it.
Characterで実装されています。
|
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.
idx | The index of the inventory slot to unequip from. |
Characterで実装されています。
|
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.
idx | The index of the inventory slot containing the Materia to use. |
target | The ICharacter object on which the Materia will be used. |
Characterで実装されています。