|
CPP04 1.0
|
Manages AMateria objects that are temporarily "dropped" in the game.
[詳解]
#include <DroppedMateriaManager.hpp>

公開メンバ関数 | |
| 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. | |
| 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. | |
| ~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. | |
| AMateria * | 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. | |
| 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.hpp の 42 行目に定義があります。
| DroppedMateriaManager::DroppedMateriaManager | ( | ) |
Default constructor for DroppedMateriaManager. Initializes the manager with an empty list of dropped materias.
DroppedMateriaManager.cpp の 30 行目に定義があります。
| 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.
| other | The DroppedMateriaManager object to copy from. |
DroppedMateriaManager.cpp の 43 行目に定義があります。
| DroppedMateriaManager::~DroppedMateriaManager | ( | ) |
Destructor for DroppedMateriaManager. Automatically clears all remaining dropped materias by deallocating their memory.
DroppedMateriaManager.cpp の 78 行目に定義があります。
| 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.
| materia | A pointer to the AMateria object to add. |
DroppedMateriaManager.cpp の 89 行目に定義があります。
| 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.cpp の 151 行目に定義があります。
| void DroppedMateriaManager::displayDroppedMaterias | ( | ) | const |
Displays the types and slots of all currently dropped materias for debugging.
DroppedMateriaManager.cpp の 166 行目に定義があります。
| int DroppedMateriaManager::getCount | ( | ) | const |
Gets the current count of dropped materias being managed.
DroppedMateriaManager.cpp の 145 行目に定義があります。
| 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.
| index | The index (0 to MAX_DROPPED_MATERIAS-1) of the materia to get. |
AMateria object if found and valid, otherwise NULL. DroppedMateriaManager.cpp の 119 行目に定義があります。
| 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.
| other | The DroppedMateriaManager object to assign from. |
DroppedMateriaManager.cpp の 58 行目に定義があります。
| 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.
| index | The index (0 to MAX_DROPPED_MATERIAS-1) of the materia to remove. |
DroppedMateriaManager.cpp の 132 行目に定義があります。