summaryrefslogtreecommitdiff
path: root/ex00
diff options
context:
space:
mode:
authorDominik Kaiser2025-02-10 10:46:17 +0100
committerDominik Kaiser2025-02-10 10:46:17 +0100
commitdc032706847335c7e76b26492725939318f5f84e (patch)
tree97e162c79bc9f22bbb7df6f880eca7737f2f4c99 /ex00
parent0970deac9b22fce59751eb45ba2730bd7e195443 (diff)
downloadcpp01-dc032706847335c7e76b26492725939318f5f84e.tar.gz
cpp01-dc032706847335c7e76b26492725939318f5f84e.zip
Add and implement Zombie class
Diffstat (limited to 'ex00')
-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