diff --git a/ex02/Makefile b/ex02/Makefile index 97cfe3b..cdec6c3 100644 --- a/ex02/Makefile +++ b/ex02/Makefile @@ -1,6 +1,6 @@ NAME = fragtrap -SRCS = main.cpp ClapTrap/ClapTrap.cpp ScavTrap/ScavTrap.cpp +SRCS = main.cpp ClapTrap/ClapTrap.cpp ScavTrap/ScavTrap.cpp FragTrap/FragTrap.cpp OBJS=$(SRCS:.cpp=.o) CC=c++ diff --git a/ex02/ScavTrap/ScavTrap.cpp b/ex02/ScavTrap/ScavTrap.cpp index 48b7633..e7d59cc 100644 --- a/ex02/ScavTrap/ScavTrap.cpp +++ b/ex02/ScavTrap/ScavTrap.cpp @@ -30,7 +30,17 @@ ScavTrap::ScavTrap(std::string name) : ClapTrap(name) << std::endl; } -ScavTrap::ScavTrap(const ScavTrap &other) : ClapTrap(other) { } +ScavTrap::ScavTrap(const ScavTrap &other) : ClapTrap(other) +{ + + this->name = other.name; + this->health = other.health; + this->energy = other.energy; + this->attackDamage = other.attackDamage; + + std::cout << "ScavTrap copy constructor called for " << this->name << std::endl; + +} ScavTrap& ScavTrap::operator=(const ScavTrap &other) { diff --git a/ex02/main.cpp b/ex02/main.cpp index 87f74e4..288ae24 100644 --- a/ex02/main.cpp +++ b/ex02/main.cpp @@ -6,12 +6,13 @@ /* By: aortigos