diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-11-12 15:46:07 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-11-12 15:46:07 +0100 |
| commit | b8e39b947890e74d82530e25ad9d02668aae1f0c (patch) | |
| tree | f59acfdecb0711137c200a4c5acb854e351f9cf9 /cpp04/ex01/AWeapon.cpp | |
| parent | 96dcf214a8c40529b251ea31ef037868583dd1da (diff) | |
| download | piscine_cpp-b8e39b947890e74d82530e25ad9d02668aae1f0c.tar.gz piscine_cpp-b8e39b947890e74d82530e25ad9d02668aae1f0c.tar.bz2 piscine_cpp-b8e39b947890e74d82530e25ad9d02668aae1f0c.zip | |
Reformating cpp04 classes
Diffstat (limited to 'cpp04/ex01/AWeapon.cpp')
| -rw-r--r-- | cpp04/ex01/AWeapon.cpp | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/cpp04/ex01/AWeapon.cpp b/cpp04/ex01/AWeapon.cpp index 9c53839..5d43cd5 100644 --- a/cpp04/ex01/AWeapon.cpp +++ b/cpp04/ex01/AWeapon.cpp @@ -6,48 +6,30 @@ /* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/14 12:16:04 by charles #+# #+# */ -/* Updated: 2020/04/14 13:18:07 by charles ### ########.fr */ +/* Updated: 2020/11/12 13:32:58 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include "AWeapon.hpp" -AWeapon::AWeapon(AWeapon const& other) -{ - *this = other; -} - -void AWeapon::operator=(AWeapon const& other) -{ - m_name = other.m_name; - m_apcost = other.m_apcost; - m_damage = other.m_damage; -} - -AWeapon::~AWeapon() -{ -} - AWeapon::AWeapon(std::string const& name, int apcost, int damage) : m_name(name), m_apcost(apcost), m_damage(damage) -{ -} +{} -std::string const& AWeapon::getName() const -{ - return m_name; -} +AWeapon::AWeapon(AWeapon const& other) { *this = other; } -int AWeapon::getAPCost() const +AWeapon& AWeapon::operator=(AWeapon const& other) { - return m_apcost; + m_name = other.m_name; + m_apcost = other.m_apcost; + m_damage = other.m_damage; + return *this; } -int AWeapon::getDamage() const -{ - return m_damage; -} +AWeapon::~AWeapon() {} -AWeapon::AWeapon() -{ -} +std::string const& AWeapon::getName() const { return m_name; } +int AWeapon::getAPCost() const { return m_apcost; } +int AWeapon::getDamage() const { return m_damage; } + +AWeapon::AWeapon() {} |
