aboutsummaryrefslogtreecommitdiff
path: root/cpp01/ex06/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp01/ex06/main.cpp')
-rw-r--r--cpp01/ex06/main.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/cpp01/ex06/main.cpp b/cpp01/ex06/main.cpp
new file mode 100644
index 0000000..dfc03a0
--- /dev/null
+++ b/cpp01/ex06/main.cpp
@@ -0,0 +1,34 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/02 16:40:20 by cacharle #+# #+# */
+/* Updated: 2020/02/02 16:40:51 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "Weapon.hpp"
+#include "HumanA.hpp"
+#include "HumanB.hpp"
+
+int main()
+{
+ {
+ Weapon club = Weapon("crude spiked club");
+ HumanA bob("Bob", club);
+ bob.attack();
+ club.setType("some other type of club");
+ bob.attack();
+ }
+ {
+ Weapon club = Weapon("crude spiked club");
+ HumanB jim("Jim");
+ jim.setWeapon(club);
+ jim.attack();
+ club.setType("some other type of club");
+ jim.attack();
+ }
+}