initial commit
[COMP345---Clone.git] / Shield.cpp
bloba2b1fa8b98d5fd1a6999311d89fa76ff146ebab3
1 //!@file Shield.cpp
2 //! @brief Implementation of Shield equipment
3 //!
4 //! This class represents the shield that is equipped or carried by a character
5 //! This class validates the shield and assigns its stats
6 #include "Shield.h"
10 //! Default shield constructor sets stats to 1
11 Shield::Shield()
13 ac = 1;
14 level = 1;
15 setName("shield");
18 //! shield constructor sets stats.
19 //! @param s_ac: the armor class to be set
20 //! @param s_level the level to be set to
21 Shield::Shield(int s_ac, int s_level)
23 ac = s_ac;
24 level = s_level;
25 name = "shield";
28 //! Shield constructor sets stats based on level.
29 //! @param s_level the level which designates stat values
30 Shield::Shield(int s_level)
32 ac = s_level;
33 level = s_level;
34 setName("shield");
38 Shield::~Shield()
42 //! Validates the Shield
43 //! Shield has an armor class attribute that must be between 1 and 5
44 bool Shield::validateEquipment()
46 if (ac < 1 || ac > 5)
47 return false;
48 else
49 return true;
52 //! Sets the shield stats to the given level
53 void Shield::levelUpEquipment(int h_level)
55 ac = h_level;