From b8e39b947890e74d82530e25ad9d02668aae1f0c Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 12 Nov 2020 15:46:07 +0100 Subject: Reformating cpp04 classes --- cpp04/ex03/AMateria.cpp | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'cpp04/ex03/AMateria.cpp') diff --git a/cpp04/ex03/AMateria.cpp b/cpp04/ex03/AMateria.cpp index 77e674b..1dc7ca9 100644 --- a/cpp04/ex03/AMateria.cpp +++ b/cpp04/ex03/AMateria.cpp @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/14 16:26:57 by charles #+# #+# */ -/* Updated: 2020/04/14 16:35:09 by charles ### ########.fr */ +/* Updated: 2020/11/12 15:40:23 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,35 +18,23 @@ AMateria::AMateria(AMateria const& other) m_type = ""; } -void AMateria::operator=(AMateria const& other) +AMateria& AMateria::operator=(AMateria const& other) { _xp = other._xp; + return *this; } -AMateria::~AMateria() -{ -} +AMateria::~AMateria() {} -AMateria::AMateria(std::string const& type) - : m_type(type), _xp(0) -{ -} +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; -} +unsigned int AMateria::getXP() const { return _xp; } -void AMateria::use(ICharacter& target) -{ - _xp += 10; -} +void AMateria::use(ICharacter& target) { _xp += 10; } -AMateria::AMateria() -{ -} +AMateria::AMateria() {} -- cgit