aboutsummaryrefslogtreecommitdiff
path: root/cpp04/ex00/Peon.cpp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-12-11 12:11:50 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-12-11 12:11:50 +0100
commitc10aa969c60cedef893146307fa319250901465a (patch)
treee3dfa785191047ee8e2ed533f963fe7c5cd7aacf /cpp04/ex00/Peon.cpp
parent6169d697a5be59426d034b878bffc848de49491d (diff)
downloadpiscine_cpp-c10aa969c60cedef893146307fa319250901465a.tar.gz
piscine_cpp-c10aa969c60cedef893146307fa319250901465a.tar.bz2
piscine_cpp-c10aa969c60cedef893146307fa319250901465a.zip
Fixing cpp04 according to correction
Diffstat (limited to 'cpp04/ex00/Peon.cpp')
-rw-r--r--cpp04/ex00/Peon.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/cpp04/ex00/Peon.cpp b/cpp04/ex00/Peon.cpp
index 8388dc9..a3c2b4e 100644
--- a/cpp04/ex00/Peon.cpp
+++ b/cpp04/ex00/Peon.cpp
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/13 20:53:16 by charles #+# #+# */
-/* Updated: 2020/11/12 13:01:42 by cacharle ### ########.fr */
+/* Updated: 2020/12/11 10:17:35 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -23,7 +23,10 @@ Peon& Peon::operator=(Peon const& other)
return *this;
}
-Peon::Peon(Peon const& other) : Victim(other) {}
+Peon::Peon(Peon const& other) : Victim(other)
+{
+ std::cout << "Zog zog." << std::endl;
+}
Peon::~Peon()
{
@@ -34,3 +37,31 @@ void Peon::getPolymorphed() const
{
std::cout << m_name << " has been turned into a pink pony!" << std::endl;
}
+
+/************************************************************************************/
+
+Rat::Rat(std::string const& name) : Victim(name)
+{
+ std::cout << "Rats rats, everywhere you look, everywhere you turn there is rats." << std::endl;
+}
+
+Rat& Rat::operator=(Rat const& other)
+{
+ Victim::operator=(other);
+ return *this;
+}
+
+Rat::Rat(Rat const& other) : Victim(other)
+{
+ std::cout << "Rats rats, everywhere you look, everywhere you turn there is rats." << std::endl;
+}
+
+Rat::~Rat()
+{
+ std::cout << "I'll stop runing everything now" << std::endl;
+}
+
+void Rat::getPolymorphed() const
+{
+ std::cout << m_name << " has been turned into Ninja" << std::endl;
+}