#include "ScavTrap.hpp"

void	goAttack(ClapTrap & robot1, ClapTrap & robot2) {

	std::cout << ".";
	robot1.attack(robot2.getName());
	std::cout << " ";
	robot2.takeDamage(robot1.getAttack());
	std::cout << " ";
	robot2.beRepaired(robot1.getAttack());

}

void	goAttack(ScavTrap & robot1, ScavTrap & robot2) {

	std::cout << ".";
	robot1.attack(robot2.getName());
	std::cout << " ";
	robot2.takeDamage(robot1.getAttack());
	std::cout << " ";
	robot2.beRepaired(robot1.getAttack());

}

void	goAttack(ClapTrap & robot1, ScavTrap & robot2) {

	std::cout << ".";
	robot1.attack(robot2.getName());
	std::cout << " ";
	robot2.takeDamage(robot1.getAttack());
	std::cout << " ";
	robot2.beRepaired(robot1.getAttack());

}

void	goAttack(ScavTrap & robot1, ClapTrap & robot2) {

	std::cout << ".";
	robot1.attack(robot2.getName());
	std::cout << " ";
	robot2.takeDamage(robot1.getAttack());
	std::cout << " ";
	robot2.beRepaired(robot1.getAttack());

}

int	main() {

	ClapTrap robot1("robot1");
	ScavTrap robot2("robot2");
	ScavTrap robot3("robot3");
	ClapTrap robot4("robot4");

	goAttack(robot1, robot2);
	goAttack(robot2, robot1);
	goAttack(robot1, robot3);
	robot2.guardGate();
	goAttack(robot1, robot4);
	goAttack(robot4, robot2);
	goAttack(robot2, robot3);
	goAttack(robot2, robot4);
	robot3.guardGate();
	goAttack(robot3, robot1);
	robot2.guardGate();
	goAttack(robot3, robot4);
	goAttack(robot2, robot1);
	goAttack(robot2, robot4);
	goAttack(robot1, robot3);

	return 0;
}
