/ CPP_Modules / CPP_Module_04 / ex03 / AMateria.cpp
AMateria.cpp
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   AMateria.cpp                                       :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: gychoi <gychoi@student.42seoul.kr>         +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2023/08/17 22:05:25 by gychoi            #+#    #+#             */
 9  /*   Updated: 2023/08/17 23:42:51 by gychoi           ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #include "AMateria.hpp"
14  
15  /******************************
16   * Constructor and Destructor *
17   ******************************/
18  
19  AMateria::AMateria(void) : type("AMateria") {}
20  
21  AMateria::~AMateria(void) {}
22  
23  AMateria::AMateria(std::string const& type) : type(type) {}
24  
25  AMateria::AMateria(AMateria const& target)
26  {
27  	if (this != &target)
28  		*this = target;
29  }
30  
31  AMateria&	AMateria::operator=(AMateria const& target)
32  {
33  	if (this != &target)
34  		static_cast<void>(target);
35  	return *this;
36  }
37  
38  /******************************
39   *      Getter  function      *
40   ******************************/
41  
42  std::string const&	AMateria::getType(void) const
43  {
44  	return this->type;
45  }
46  
47  void	AMateria::use(ICharacter& target)
48  {
49  	static_cast<void>(target);
50  }