aboutsummaryrefslogtreecommitdiff
path: root/cpp04/ex02/TacticalMarine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp04/ex02/TacticalMarine.cpp')
-rw-r--r--cpp04/ex02/TacticalMarine.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/cpp04/ex02/TacticalMarine.cpp b/cpp04/ex02/TacticalMarine.cpp
new file mode 100644
index 0000000..f2684ba
--- /dev/null
+++ b/cpp04/ex02/TacticalMarine.cpp
@@ -0,0 +1,55 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* TacticalMarine.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/04/14 15:31:43 by charles #+# #+# */
+/* Updated: 2020/04/14 15:45:55 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "TacticalMarine.hpp"
+
+TacticalMarine::TacticalMarine()
+{
+ std::cout << "Tactical Marine ready for battle!" << std::endl;
+}
+
+TacticalMarine::TacticalMarine(TacticalMarine const& other)
+{
+ *this = other;
+}
+
+void TacticalMarine::operator=(TacticalMarine const& other)
+{
+ (void)other;
+}
+
+TacticalMarine::~TacticalMarine()
+{
+ std::cout << "Aaargh..." << std::endl;
+}
+
+ISpaceMarine* TacticalMarine::clone() const
+{
+ ISpaceMarine* cloned = new TacticalMarine();
+ *cloned = *this;
+ return cloned;
+}
+
+void TacticalMarine::battleCry() const
+{
+ std::cout << "For the holy PLOT!" << std::endl;
+}
+
+void TacticalMarine::rangedAttack() const
+{
+ std::cout << "* attacks with a botler *" << std::endl;
+}
+
+void TacticalMarine::meleeAttack() const
+{
+ std::cout << "* attacks with a chainsword *" << std::endl;
+}