From b8e39b947890e74d82530e25ad9d02668aae1f0c Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 12 Nov 2020 15:46:07 +0100 Subject: Reformating cpp04 classes --- cpp04/ex00/main.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 7 deletions(-) (limited to 'cpp04/ex00/main.cpp') diff --git a/cpp04/ex00/main.cpp b/cpp04/ex00/main.cpp index 9c17e99..8bf96bf 100644 --- a/cpp04/ex00/main.cpp +++ b/cpp04/ex00/main.cpp @@ -6,25 +6,64 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 20:47:34 by charles #+# #+# */ -/* Updated: 2020/04/13 20:57:19 by charles ### ########.fr */ +/* Updated: 2020/11/12 13:11:26 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ +#include #include "Sorcerer.hpp" #include "Victim.hpp" #include "Peon.hpp" int main() { - Sorcerer robert("Robert", "the Magnificent"); + { + std::cout << "==================== SUBJECT MAIN =====================" << std::endl; + Sorcerer robert("Robert", "the Magnificent"); + Victim jim("Jimmy"); + Peon joe("Joe"); + std::cout << robert << jim << joe; + robert.polymorph(jim); + robert.polymorph(joe); + } - Victim jim("Jimmy"); - Peon joe("Joe"); + std::cout << std::endl; - std::cout << robert << jim << joe; + { + std::cout << "==================== SORCERER =====================" << std::endl; + Sorcerer s("DidierLeSorcier", "The cunt"); + Sorcerer s_copied(s); + Sorcerer s_assigned("foo", "yep clock"); + s_assigned = s; + std::cout << "Copied: " << s_copied; + std::cout << "Assigned: " << s_assigned; + } - robert.polymorph(jim); - robert.polymorph(joe); + std::cout << std::endl; + + { + std::cout << "==================== VICTIM =====================" << std::endl; + Victim v("Victoire"); + Victim v_copied(v); + Victim v_assigned("bar"); + v_assigned = v; + std::cout << "Copied: " << v_copied; + std::cout << "Assigned: " << v_assigned; + v.getPolymorphed(); + } + + std::cout << std::endl; + + { + std::cout << "==================== PEON =====================" << std::endl; + Peon p("Victoire"); + Peon p_copied(p); + Peon p_assigned("baz"); + p_assigned = p; + std::cout << "Copied: " << p_copied; + std::cout << "Assigned: " << p_assigned; + p.getPolymorphed(); + } return 0; } -- cgit