initial commit
[COMP345---Clone.git] / Boots.cpp
blob04edc2426d208c054307ea2f783ff83f1afc351e
1 //!@file Boots.cpp
2 //! @brief Implementation of Boots equipment
3 //!
4 //! This class represents the boots that is equipped or carried by a character
5 //! This class validates the boots and assigns its stats
6 #include "Boots.h"
8 //! Default boots constructor sets stats to 1
9 Boots::Boots()
11 dex = 1;
12 ac = 1;
13 level = 1;
14 setName("boots");
17 //! Ring constructor sets stats.
18 //! @param b_ac: the armor class to be set
19 //! @param b_dex the value of dexterity to be set
20 //! @param b_level the level to be set to
21 Boots::Boots(int b_dex, int b_ac, int b_level)
23 dex = b_dex;
24 ac = b_ac;
25 level = b_level;
26 setName("boots");
29 //! Boots constructor sets stats based on level.
30 //! @param b_level the level which designates stat values
31 Boots::Boots(int b_level)
33 name = "boots";
34 levelUpEquipment(b_level);
38 Boots::~Boots()
42 //! Validates the ring
43 //! Ring has an armor class attribute that must be between 1 and 5
44 //! Ring has an dexterity attribute that must be between 1 and 5
45 bool Boots::validateEquipment()
47 if (ac < 1 || ac > 5 ||
48 dex < 1 || dex > 5)
49 return false;
50 else
51 return true;
54 //! Sets the boots stats to the given level
55 void Boots::levelUpEquipment(int b_level)
57 dex = b_level;
58 ac = b_level;
59 level = b_level;