2 //! @brief Implementation of Ring equipment
4 //! This class represents the ring that is equipped or carried by a character
5 //! This class validates the ring and assigns its stats
8 //! Default ring constructor sets stats to 1
21 //! Ring constructor sets stats.
22 //! @param r_ac: the armor class to be set
23 //! @param r_wis the value of wisdom to be set
24 //! @param r_cha the value of charisma to be set
25 //! @param r_str the value of strength to be set
26 //! @param r_con the value of consitution to be set
27 //! @param r_level the level to be set to
28 Ring::Ring(int r_ac
, int r_wis
, int r_str
, int r_cha
, int r_con
, int r_level
)
39 //! Ring constructor sets stats based on level.
40 //! @param r_level the level which designates stat values
41 Ring::Ring(int r_level
)
43 levelUpEquipment(r_level
);
52 //! Validates the ring
53 //! Ring has an armor class attribute that must be between 1 and 5
54 //! Ring has an wisdom attribute that must be between 1 and 5
55 //! Ring has an strength attribute that must be between 1 and 5
56 //! Ring has an charisma attribute that must be between 1 and 5
57 //! Ring has an constitution attribute that must be between 1 and 5
58 bool Ring::validateEquipment()
60 if (ac
< 1 || ac
> 5 ||
63 constitution
< 1 || constitution
> 5 ||
64 charisma
< 1 || charisma
> 5)
71 //! Sets the ring stats to the given level
72 void Ring::levelUpEquipment(int r_level
)
78 constitution
= r_level
;