initial commit
[COMP345---Clone.git] / Armor.cpp
blob409f15bab2a41d2950e7bdff7865de87b7462326
1 //!@file Armor.cpp
2 //! @brief Implementation of armor equipment
3 //!
4 //! This class represents armor that is equipped or carried by a character
5 //! This class validates armor and assigns its stats
6 #include "Armor.h"
8 //! Default armor constructor sets stats to 1
9 Armor::Armor()
11 ac = 1;
12 level = 1;
13 setName("armor");
16 //! Armor constructor sets stats.
17 //! @param armorClass: the armor class to be set
18 //! @param a_level the level to be set to
19 Armor::Armor(int armorClass, int a_level)
21 ac = armorClass;
22 name = "armor";
23 level = a_level;
26 //! Armor constructor sets stats based on level.
27 //! @param a_level the level which designates stat values
28 Armor::Armor(int a_level)
30 level = a_level;
31 ac = a_level;
32 name = "armor";
36 Armor::~Armor()
41 //! Validates the armor
42 //! Armor has an armor class attribute that must be between 1 and 5
43 bool Armor::validateEquipment()
45 if (ac < 1 || ac > 5 )
46 return false;
47 else
48 return true;
51 //! Sets the armor stats to the given level
52 void Armor::levelUpEquipment(int a_level)
54 ac = a_level;