aboutsummaryrefslogtreecommitdiff
path: root/cpp04/ex02/TacticalMarine.cpp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-11-13 14:43:17 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-11-13 14:43:17 +0100
commit4c30e98f4a4018a25d3a9f3ee790d589be803cb0 (patch)
tree655a4bd52a7a6633a32782eab935fb01a47040e9 /cpp04/ex02/TacticalMarine.cpp
parentb8e39b947890e74d82530e25ad9d02668aae1f0c (diff)
downloadpiscine_cpp-4c30e98f4a4018a25d3a9f3ee790d589be803cb0.tar.gz
piscine_cpp-4c30e98f4a4018a25d3a9f3ee790d589be803cb0.tar.bz2
piscine_cpp-4c30e98f4a4018a25d3a9f3ee790d589be803cb0.zip
Added main for cpp04/ex01 and cpp04/ex02, Fixed cpp04/03 MateriaSource
Diffstat (limited to 'cpp04/ex02/TacticalMarine.cpp')
-rw-r--r--cpp04/ex02/TacticalMarine.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp04/ex02/TacticalMarine.cpp b/cpp04/ex02/TacticalMarine.cpp
index df771e8..cf30d2a 100644
--- a/cpp04/ex02/TacticalMarine.cpp
+++ b/cpp04/ex02/TacticalMarine.cpp
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/14 15:31:43 by charles #+# #+# */
-/* Updated: 2020/11/12 15:37:41 by cacharle ### ########.fr */
+/* Updated: 2020/11/13 12:18:14 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,7 +17,11 @@ TacticalMarine::TacticalMarine()
std::cout << "Tactical Marine ready for battle!" << std::endl;
}
-TacticalMarine::TacticalMarine(TacticalMarine const& other) { *this = other; }
+TacticalMarine::TacticalMarine(TacticalMarine const& other)
+{
+ std::cout << "Tactical Marine ready for battle!" << std::endl;
+ *this = other;
+}
TacticalMarine& TacticalMarine::operator=(TacticalMarine const& other)
{
@@ -32,8 +36,7 @@ TacticalMarine::~TacticalMarine()
ISpaceMarine* TacticalMarine::clone() const
{
- ISpaceMarine* cloned = new TacticalMarine();
- *cloned = *this;
+ ISpaceMarine* cloned = new TacticalMarine(*this);
return cloned;
}