aboutsummaryrefslogtreecommitdiff
path: root/cpp04/ex01/Character.hpp
blob: 08f1b59e703436f7ff4f419d0992a8cde3fd9407 (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
41
42
43
44
45
46
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   Character.hpp                                      :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: charles <charles.cabergs@gmail.com>        +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/04/14 13:42:25 by charles           #+#    #+#             */
/*   Updated: 2020/11/13 11:14:03 by cacharle         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef CHARACTER_HPP
# define CHARACTER_HPP

# include <iostream>
# include <string>
# include "AWeapon.hpp"
# include "Enemy.hpp"

class Character
{
public:
    Character(Character const& other);
    Character& operator=(Character const& other);
    ~Character();

    Character(std::string const& name);
    void recoverAP();
    void equip(AWeapon *weapon);
    void attack(Enemy *enemy);
    std::string const& getName() const;
    int getAP() const;
    AWeapon* getWeapon() const;

private:
    Character();

    std::string m_name;
    int         m_ap;
    AWeapon*    m_weapon;
};

std::ostream& operator<<(std::ostream& out, Character const& c);

#endif