CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
DroppedMateriaManager.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* DroppedMateriaManager.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/06/02 00:47:15 by kamitsui #+# #+# */
9/* Updated: 2025/06/06 12:33:35 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
22#ifndef DROPPED_MATERIA_MANAGER_HPP
23#define DROPPED_MATERIA_MANAGER_HPP
24
25#include "AMateria.hpp" // Required for AMateria* to manage dropped items
26#include <iostream> // For output messages (e.g., std::cout)
27
31#define MAX_DROPPED_MATERIAS 16
32
43 private:
44 AMateria *droppedMaterias[MAX_DROPPED_MATERIAS];
45 int count;
46
47 public:
52
53 void addMateria(AMateria *materia);
54
55 AMateria *getMateria(int index);
56
57 void removeMateria(int index);
58
59 int getCount() const;
60
61 void clearAll();
62
63 void displayDroppedMaterias() const;
64};
65
66#endif
Declares the AMateria abstract base class.
#define MAX_DROPPED_MATERIAS
Defines the maximum number of Materias that can be managed at once.
Represents an abstract base class for all magical materias.
Definition AMateria.hpp:42
Manages AMateria objects that are temporarily "dropped" in the game.
~DroppedMateriaManager()
Destructor for DroppedMateriaManager. Automatically clears all remaining dropped materias by dealloca...
void clearAll()
Clears all currently managed dropped materias by deallocating their memory. This method is typically ...
void removeMateria(int index)
Removes a materia from a specific index in the dropped list without deleting it. This implies ownersh...
void displayDroppedMaterias() const
Displays the types and slots of all currently dropped materias for debugging.
DroppedMateriaManager()
Default constructor for DroppedMateriaManager. Initializes the manager with an empty list of dropped ...
DroppedMateriaManager & operator=(const DroppedMateriaManager &other)
Copy assignment operator for DroppedMateriaManager. Resets the current manager's list to empty,...
void addMateria(AMateria *materia)
Adds a materia to the list of dropped materias. Takes ownership of the passed AMateria pointer....
int getCount() const
Gets the current count of dropped materias being managed.
AMateria * getMateria(int index)
Gets a pointer to a materia at a specific index in the dropped list. This method transfers ownership ...