aboutsummaryrefslogtreecommitdiff
path: root/cpp04/ex03/AMateria.cpp
blob: 1dc7ca9e27ccd4f0d02a245b471993dc9061ad01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   AMateria.cpp                                       :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: charles <charles.cabergs@gmail.com>        +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/04/14 16:26:57 by charles           #+#    #+#             */
/*   Updated: 2020/11/12 15:40:23 by cacharle         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "AMateria.hpp"

AMateria::AMateria(AMateria const& other)
{
    *this = other;
    m_type = "";
}

AMateria& AMateria::operator=(AMateria const& other)
{
    _xp = other._xp;
    return *this;
}

AMateria::~AMateria() {}

AMateria::AMateria(std::string const& type) : m_type(type), _xp(0) {}

std::string const& AMateria::getType() const
{
    return m_type;
}

unsigned int AMateria::getXP() const { return _xp; }

void AMateria::use(ICharacter& target) { _xp += 10; }

AMateria::AMateria() {}