mastring the simple heritage
This commit is contained in:
parent
245ac4c3a9
commit
d161579a2a
13 changed files with 376 additions and 4 deletions
27
cpp03/ex02/ScavTrap.cpp
Normal file
27
cpp03/ex02/ScavTrap.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ScavTrap.cpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/01/24 17:41:01 by rparodi #+# #+# */
|
||||
/* Updated: 2025/01/24 19:24:05 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "ScavTrap.hpp"
|
||||
|
||||
ScavTrap::ScavTrap (std::string name) {
|
||||
_name = name;
|
||||
_hit_point = 100;
|
||||
_energy_point = 50;
|
||||
_attack_damage = 20;
|
||||
_gateKeeperMode = false;
|
||||
std::cout << "\n[Init] ScavTrap:\n\t" << "Name: " << _name << std::endl;
|
||||
}
|
||||
|
||||
void ScavTrap::guardGate() {
|
||||
_gateKeeperMode = !_gateKeeperMode;
|
||||
std::cout << "\n[Mode] ScavTrap:\n\t" << "Name: " << _name << " the mode gate keeper is now: " << (_gateKeeperMode ? "enable" : "disable") << std::endl;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue