From 631a8d7b6c214da48f7748e78fc8c308960414fb Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 9 Nov 2020 12:58:53 +0100 Subject: Fixing cpp01/03 single allocation for zombies in horde --- cpp01/ex03/Zombie.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'cpp01/ex03/Zombie.cpp') diff --git a/cpp01/ex03/Zombie.cpp b/cpp01/ex03/Zombie.cpp index 79f6ad2..a8104d4 100644 --- a/cpp01/ex03/Zombie.cpp +++ b/cpp01/ex03/Zombie.cpp @@ -6,13 +6,17 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 09:38:16 by charles #+# #+# */ -/* Updated: 2020/11/09 10:38:44 by cacharle ### ########.fr */ +/* Updated: 2020/11/09 12:53:44 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ #include #include "Zombie.hpp" +Zombie::Zombie() + : m_name(""), m_type("") +{} + Zombie::Zombie(std::string const& name, std::string const& type) : m_name(name), m_type(type) { @@ -28,3 +32,13 @@ void Zombie::announce() { std::cout << "<" << m_name << " (" << m_type << ")> Braiiiiiiinnnssss..." << std::endl; } + +void Zombie::setName(std::string const& name) +{ + m_name = name; +} + +void Zombie::setType(std::string const& type) +{ + m_type = type; +} -- cgit