initial commit
[COMP345---Clone.git] / Belt.cpp
blob8bd264aea6afae1b9a54bcaed87bfc2c1a5560bc
1 //!@file Belt.cpp
2 //! @brief Implementation of belt equipment
3 //!
4 //! This class represents the belt that is equipped or carried by a character
5 //! This class validates the belt and assigns its stats
6 #include "Belt.h"
8 //! Default belt constructor sets stats to 1
9 Belt::Belt()
11 str = 1;
12 constitution = 1;
13 level = 1;
14 setName("belt");
17 //! Beltconstructor sets stats.
18 //! @param b_str: the strength to be set
19 //! @param b_con: the constitution to be set
20 //! @param b_level the level to be set to
21 Belt::Belt(int b_str, int b_con, int b_level)
23 str = b_str;
24 constitution = b_con;
25 level = b_level;
26 setName("belt");
30 //! Beltconstructor sets stats based on level.
31 //! @param b_level the level which designates stat values
32 Belt::Belt(int b_level)
34 level = b_level;
35 str = b_level;
36 constitution = b_level;
37 name = "belt";
41 Belt::~Belt()
45 //! Validates the armor
46 //! Belt has a strength attribute that must be between 1 and 5
47 //! Belt has a constitution attribute that must be between 1 and 5
48 bool Belt::validateEquipment()
50 if (str < 1 || str > 5 ||
51 constitution < 1 || constitution> 5)
52 return false;
53 else
54 return true;
57 //! Sets the belt stats to the given level
58 void Belt::levelUpEquipment(int b_level)
60 str = b_level;
61 constitution = b_level;