From aa40eb5dedd39263ff511de01d6833d24e33b736 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 10 Nov 2020 14:50:38 +0100 Subject: Changing operator= and const reference in Traps --- cpp03/ex02/ClapTrap.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpp03/ex02/ClapTrap.hpp') diff --git a/cpp03/ex02/ClapTrap.hpp b/cpp03/ex02/ClapTrap.hpp index 5f4e26a..71879b6 100644 --- a/cpp03/ex02/ClapTrap.hpp +++ b/cpp03/ex02/ClapTrap.hpp @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 15:20:45 by charles #+# #+# */ -/* Updated: 2020/04/13 15:47:14 by charles ### ########.fr */ +/* Updated: 2020/11/10 14:29:37 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -21,9 +21,9 @@ class ClapTrap { public: ClapTrap(); - ClapTrap(std::string name); + ClapTrap(std::string const& name); ClapTrap(ClapTrap const& other); - void operator=(ClapTrap const& other); + ClapTrap& operator=(ClapTrap const& other); ~ClapTrap(); void rangedAttack(std::string const& target) const; @@ -32,14 +32,14 @@ public: void beRepaired(unsigned int amount); protected: - std::string m_prefix; + std::string m_prefix; unsigned int m_hitPoints; unsigned int m_maxHitPoints; unsigned int m_energyPoints; unsigned int m_maxEnergyPoints; unsigned int m_level; - std::string m_name; + std::string m_name; unsigned int m_meleeAttackDamage; unsigned int m_rangedAttackDamage; unsigned int m_armorDamageReduction; -- cgit