| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ScavTrap.cpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2025/12/18 14:28:06 by bchanot #+# #+# */
- /* Updated: 2025/12/18 14:50:00 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "ScavTrap.hpp"
- /*
- ** ------------------------------- CONSTRUCTOR --------------------------------
- */
- ScavTrap::ScavTrap() : ClapTrap()
- {
- this->_hitPoints = 100;
- this->_energyPoints = 50;
- this->_attackDamage = 20;
- std::cout << "ScavTrap " << this->_name << " has been created" << std::endl;
- }
- ScavTrap::ScavTrap( std::string const & name ) : ClapTrap(name)
- {
- this->_hitPoints = 100;
- this->_energyPoints = 50;
- this->_attackDamage = 20;
- std::cout << "ScavTrap " << this->_name << " has been created" << std::endl;
- }
- ScavTrap::ScavTrap( ScavTrap const & src ) : ClapTrap(src)
- {
- this->_hitPoints = 100;
- this->_energyPoints = 50;
- this->_attackDamage = 20;
- std::cout << "Copy of ScavTrap " << this->_name << " has been created" << std::endl;
- }
- /*
- ** -------------------------------- DESTRUCTOR --------------------------------
- */
- ScavTrap::~ScavTrap()
- {
- std::cout << "ScavTrap " << this->_name << " has been destroyed !" << std::endl;
- }
- /*
- ** --------------------------------- OVERLOAD ---------------------------------
- */
- ScavTrap & ScavTrap::operator=( ScavTrap const & rhs )
- {
- (void)rhs;
- //if ( this != &rhs )
- //{
- //this->_value = rhs.getValue();
- //}
- return *this;
- }
- std::ostream & operator<<( std::ostream & o, ScavTrap const & i )
- {
- (void)i;
- //o << "Value = " << i.getValue();
- return o;
- }
- /*
- ** --------------------------------- METHODS ----------------------------------
- */
- void ScavTrap::guardGate(void) const {
- std::cout << "ScavTrap " << this->_name << " Is holding the door !" << std::endl;
- }
- /*
- ** --------------------------------- ACCESSOR ---------------------------------
- */
- /* ************************************************************************** */
|