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

Manages AMateria objects that are temporarily "dropped" in the game. [詳解]

#include <DroppedMateriaManager.hpp>

DroppedMateriaManager 連携図
Collaboration graph

公開メンバ関数

 DroppedMateriaManager ()
 Default constructor for DroppedMateriaManager. Initializes the manager with an empty list of dropped materias.
 
 DroppedMateriaManager (const DroppedMateriaManager &other)
 Copy constructor for DroppedMateriaManager. Creates a new manager with an empty list. It does not copy the ownership of materias from the 'other' manager, treating a copy as a new, independent manager.
 
DroppedMateriaManageroperator= (const DroppedMateriaManager &other)
 Copy assignment operator for DroppedMateriaManager. Resets the current manager's list to empty, deallocating any previously held materias. It does not copy materias from the 'other' manager.
 
 ~DroppedMateriaManager ()
 Destructor for DroppedMateriaManager. Automatically clears all remaining dropped materias by deallocating their memory.
 
void addMateria (AMateria *materia)
 Adds a materia to the list of dropped materias. Takes ownership of the passed AMateria pointer. If the list is full, the passed materia is immediately deleted to prevent a leak.
 
AMateriagetMateria (int index)
 Gets a pointer to a materia at a specific index in the dropped list. This method transfers ownership of the retrieved materia to the caller. The slot in the manager is set to NULL after retrieval.
 
void removeMateria (int index)
 Removes a materia from a specific index in the dropped list without deleting it. This implies ownership is transferred to an external entity (e.g., a character picking it up). The slot is simply set to NULL.
 
int getCount () const
 Gets the current count of dropped materias being managed.
 
void clearAll ()
 Clears all currently managed dropped materias by deallocating their memory. This method is typically called during the destructor or when the list needs to be reset.
 
void displayDroppedMaterias () const
 Displays the types and slots of all currently dropped materias for debugging.
 

詳解

Manages AMateria objects that are temporarily "dropped" in the game.

The DroppedMateriaManager class acts as a central handler for AMateria objects whose ownership has been relinquished by a Character (e.g., via unequip). It stores these items in a fixed-size array and is responsible for their eventual deletion if they are not collected. This class adheres to the Orthodox Canonical Class Form for proper resource management.

DroppedMateriaManager.hpp42 行目に定義があります。

構築子と解体子

◆ DroppedMateriaManager() [1/2]

DroppedMateriaManager::DroppedMateriaManager ( )

Default constructor for DroppedMateriaManager. Initializes the manager with an empty list of dropped materias.

DroppedMateriaManager.cpp30 行目に定義があります。

◆ DroppedMateriaManager() [2/2]

DroppedMateriaManager::DroppedMateriaManager ( const DroppedMateriaManager other)

Copy constructor for DroppedMateriaManager. Creates a new manager with an empty list. It does not copy the ownership of materias from the 'other' manager, treating a copy as a new, independent manager.

引数
otherThe DroppedMateriaManager object to copy from.

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

◆ ~DroppedMateriaManager()

DroppedMateriaManager::~DroppedMateriaManager ( )

Destructor for DroppedMateriaManager. Automatically clears all remaining dropped materias by deallocating their memory.

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

関数詳解

◆ addMateria()

void DroppedMateriaManager::addMateria ( AMateria materia)

Adds a materia to the list of dropped materias. Takes ownership of the passed AMateria pointer. If the list is full, the passed materia is immediately deleted to prevent a leak.

引数
materiaA pointer to the AMateria object to add.

DroppedMateriaManager.cpp89 行目に定義があります。

◆ clearAll()

void DroppedMateriaManager::clearAll ( )

Clears all currently managed dropped materias by deallocating their memory. This method is typically called during the destructor or when the list needs to be reset.

DroppedMateriaManager.cpp151 行目に定義があります。

◆ displayDroppedMaterias()

void DroppedMateriaManager::displayDroppedMaterias ( ) const

Displays the types and slots of all currently dropped materias for debugging.

DroppedMateriaManager.cpp166 行目に定義があります。

◆ getCount()

int DroppedMateriaManager::getCount ( ) const

Gets the current count of dropped materias being managed.

戻り値
The number of materias currently in the dropped list.

DroppedMateriaManager.cpp145 行目に定義があります。

◆ getMateria()

AMateria * DroppedMateriaManager::getMateria ( int  index)

Gets a pointer to a materia at a specific index in the dropped list. This method transfers ownership of the retrieved materia to the caller. The slot in the manager is set to NULL after retrieval.

引数
indexThe index (0 to MAX_DROPPED_MATERIAS-1) of the materia to get.
戻り値
A pointer to the AMateria object if found and valid, otherwise NULL.

DroppedMateriaManager.cpp119 行目に定義があります。

◆ operator=()

DroppedMateriaManager & DroppedMateriaManager::operator= ( const DroppedMateriaManager other)

Copy assignment operator for DroppedMateriaManager. Resets the current manager's list to empty, deallocating any previously held materias. It does not copy materias from the 'other' manager.

引数
otherThe DroppedMateriaManager object to assign from.
戻り値
A reference to the assigned DroppedMateriaManager object.

DroppedMateriaManager.cpp58 行目に定義があります。

◆ removeMateria()

void DroppedMateriaManager::removeMateria ( int  index)

Removes a materia from a specific index in the dropped list without deleting it. This implies ownership is transferred to an external entity (e.g., a character picking it up). The slot is simply set to NULL.

引数
indexThe index (0 to MAX_DROPPED_MATERIAS-1) of the materia to remove.

DroppedMateriaManager.cpp132 行目に定義があります。


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