This project involves creating a robot hierarchy in C++ starting with the ClapTrap
class, with basic attributes (name, hit points, energy, damage) and methods for attacking, repairing, and taking damage. The derived classes ScavTrap
, FragTrap
, and DiamondTrap
add unique abilities, showcasing inheritance and composition in C++.
Objectives 🚀:
- Implement the foundational
ClapTrap
class.
Requirements:
- Create
ClapTrap
with attributes:Name
(from constructor),Hit Points
(10),Energy Points
(10), andAttack Damage
(0). - Methods:
attack(const std::string& target)
,takeDamage(unsigned int amount)
, andbeRepaired(unsigned int amount)
.
Objectives 🚀:
- Introduce a derived class
ScavTrap
with unique attributes and behaviors.
Requirements:
- Inherit
ClapTrap
, updating initial values toHit Points
(100),Energy Points
(50),Attack Damage
(20). - Add
guardGate()
for Gate Keeper mode.
Objectives 🚀:
- Introduce a derived class
FragTrap
with unique attributes and behaviors.
Requirements:
- Inherit
ClapTrap
, updating initial values toHit Points
(100),Energy Points
(100),Attack Damage
(30). - Add
guardGate()
for Gate Keeper mode.
Objectives 🚀:
- Create a hybrid
DiamondTrap
class combiningScavTrap
andFragTrap
traits.
Requirements:
- Inherit both
FragTrap
andScavTrap
, settingName
,Hit Points
,Energy Points
, andAttack Damage
accordingly. - Add a
whoAmI()
method to displayDiamondTrap’s
identity andClapTrap
-style name.