summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ex00/Zombie.cpp18
-rw-r--r--ex00/Zombie.hpp18
2 files changed, 34 insertions, 2 deletions
diff --git a/ex00/Zombie.cpp b/ex00/Zombie.cpp
index 8e24833..bbd0a65 100644
--- a/ex00/Zombie.cpp
+++ b/ex00/Zombie.cpp
@@ -6,7 +6,23 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/10 10:27:11 by dkaiser #+# #+# */
-/* Updated: 2025/02/10 10:27:12 by dkaiser ### ########.fr */
+/* Updated: 2025/02/10 10:46:03 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
+#include "Zombie.hpp"
+#include <iostream>
+
+Zombie::Zombie(const std::string &name)
+ :name(name)
+{}
+
+Zombie::~Zombie(void)
+{
+ std::cout << name << " died." << std::endl;
+}
+
+void Zombie::announce(void)
+{
+ std::cout << name << ": BraiiiiiiinnnzzzZ..." << std::endl;
+}
diff --git a/ex00/Zombie.hpp b/ex00/Zombie.hpp
index f7dc6fe..c9f780f 100644
--- a/ex00/Zombie.hpp
+++ b/ex00/Zombie.hpp
@@ -6,7 +6,23 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/10 10:26:18 by dkaiser #+# #+# */
-/* Updated: 2025/02/10 10:26:19 by dkaiser ### ########.fr */
+/* Updated: 2025/02/10 10:38:18 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
+#ifndef ZOMBIE_H_
+#define ZOMBIE_H_
+
+#include <string>
+
+class Zombie
+{
+ public:
+ Zombie(const std::string &name);
+ ~Zombie(void);
+ void announce(void);
+ private:
+ std::string name;
+}
+
+#endif