CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
MateriaSource.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* MateriaSource.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/05/29 23:39:02 by kamitsui #+# #+# */
9/* Updated: 2025/06/06 12:51:49 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
24#ifndef MATERIASOURCE_HPP
25#define MATERIASOURCE_HPP
26
27#include "AMateria.hpp" // Required for AMateria* members and parameters
28#include "IMateriaSource.hpp" // Inherits from this interface
29#include <string> // For std::string to specify materia types
30
41 private:
42 AMateria *learnedMateria[4];
43 int learnCount;
44
45 public:
47 MateriaSource(const MateriaSource &other);
49 virtual ~MateriaSource();
50
51 virtual void learnMateria(AMateria *materia);
52 virtual AMateria *createMateria(std::string const &type) const;
53};
54
55#endif
Declares the AMateria abstract base class.
Declares the IMateriaSource interface.
Represents an abstract base class for all magical materias.
Definition AMateria.hpp:42
An interface for objects that can learn Materia templates and create new Materias.
Represents a source for learning and creating Materias.
MateriaSource()
Default constructor for MateriaSource. Initializes the learning count to zero and sets all learned Ma...
virtual ~MateriaSource()
Destroys the MateriaSource object. Deallocates all dynamically allocated AMateria objects that were l...
MateriaSource & operator=(const MateriaSource &other)
Copy assignment operator for MateriaSource. Assigns values from another MateriaSource object,...
virtual void learnMateria(AMateria *materia)
Learns a Materia template for later creation. The MateriaSource makes a deep copy of the passed Mater...
virtual AMateria * createMateria(std::string const &type) const
Creates a new Materia based on a learned type. Returns a new instance (a clone) of a previously learn...