From efea8712aaf8169b1184cceb83705ca6b8783173 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 14 Apr 2020 18:02:14 +0200 Subject: cpp04, ex03 not finished, require more sophisticated main --- cpp04/ex01/Character.hpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 cpp04/ex01/Character.hpp (limited to 'cpp04/ex01/Character.hpp') diff --git a/cpp04/ex01/Character.hpp b/cpp04/ex01/Character.hpp new file mode 100644 index 0000000..04da9fc --- /dev/null +++ b/cpp04/ex01/Character.hpp @@ -0,0 +1,46 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Character.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/14 13:42:25 by charles #+# #+# */ +/* Updated: 2020/04/14 14:09:51 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef CHARACTER_HPP +# define CHARACTER_HPP + +# include +# include +# include "AWeapon.hpp" +# include "Enemy.hpp" + +class Character +{ +public: + Character(Character const& other); + void 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 -- cgit