39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.cpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/09/12 13:17:34 by aortigos #+# #+# */
|
|
/* Updated: 2025/09/19 12:34:26 by aortigos ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ClapTrap/ClapTrap.hpp"
|
|
#include "ScavTrap/ScavTrap.hpp"
|
|
|
|
int main()
|
|
{
|
|
std::cout << "--- Testing ClapTrap ---" << std::endl;
|
|
ClapTrap a("Alice");
|
|
a.attack("enemy");
|
|
a.takeDamage(3);
|
|
a.beRepaired(2);
|
|
a.attack("enemy");
|
|
|
|
std::cout << "\n--- Testing ScavTrap ---" << std::endl;
|
|
ScavTrap b("Bob");
|
|
b.attack("enemy");
|
|
b.takeDamage(20);
|
|
b.beRepaired(10);
|
|
b.guardGate();
|
|
|
|
std::cout << "\n--- Copy and Assignment Test ---" << std::endl;
|
|
ScavTrap c = b; // copy constructor
|
|
ScavTrap d;
|
|
d = b; // assignment operator
|
|
d.attack("another enemy");
|
|
|
|
return 0;
|
|
} |