2 //! @brief Implementation of weapon equipment
4 //! This class represents the weapon that is equipped or carried by a character
5 //! This class validates the weapon and assigns its stats
10 //! Default weapon constructor sets stats to 1
19 //! Weapon constructor sets stats.
20 //! @param w_atk: the attack to be set
21 //! @param w_dmg the value of damage to be set
22 //! @param w_level the level to be set to
23 Weapon::Weapon(int w_atk
, int w_dmg
, int w_level
)
31 //! Weapon constructor sets stats based on level.
32 //! @param w_level the level which designates stat values
33 Weapon::Weapon(int w_level
)
37 levelUpEquipment(w_level
);
45 //! Validates the weapon
46 //! Weapon has an attack attribute that must be between 1 and 5
47 //! Weapon has an damage attribute that must be between 1 and 5
48 bool Weapon::validateEquipment()
50 if (atk
< 1 || atk
> 5 ||
57 //! Sets the weapon stats to the given level
58 void Weapon::levelUpEquipment(int w_level
)