Repository navigation
Expand file tree
/
Copy pathMeritsflaws.cpp
More file actions
97 lines (64 loc) · 2.25 KB
/
Copy pathMeritsflaws.cpp
File metadata and controls
97 lines (64 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* @file Meritsflaws.cpp
*
* @brief File containing source code of the Meritsflaws class
*
*
* @author Hugo MARTIN
* Contact: hugo.martin.1@etu.univ-amu.fr
*
*/
#include "classes.h"
/** Constructor of the class Meritsflaws.
*
* Modification of the constructor of Meritsflaws
* Initialisation of a Parsetext reference
* before the Meritsflaws constructor be initialised
* Initialisation of map containing Merits and Flaws
*
* @param textParse: reference of Parsetext
*/
vampireGameproject::Meritsflaws::Meritsflaws(Parsetext& textParse): textParser(textParse){
meritsFlaws.insert(std::make_pair("Physical", std::map<std::string, int>()));
meritsFlaws.insert(std::make_pair("Social", std::map<std::string, int>()));
meritsFlaws.insert(std::make_pair("Supernatural", std::map<std::string, int>()));
}
/** Destructor of the class Meritsflaws.
*
* Modification of the Destructor of Meritsflaws */
vampireGameproject::Meritsflaws::~Meritsflaws(){}
/** Implementation of the getMeritsFlaws method.
*
* Implementation of the getMeritsFlaws method
* Method returning the Merits and Flaws
*
* @param type: name of the table to return
*
*/
std::map<std::string,int> vampireGameproject::Meritsflaws::getMeritsFlaws(std::string type){
return meritsFlaws[type];
}
/** Implementation of the setMeritsFlaws method.
*
* Implementation of the setMeritsFlaws method
* Method setting Merits and Flaws values
*
* @param table: name of the table to add a merit or flaw
* @param meritsName: name of the merit or flaw to add
* @param number: value of the merit or flaw to add
*/
void vampireGameproject::Meritsflaws::setMeritsFlaws(std::string table, std::string meritsFlawName, int number){
meritsFlaws[table].insert(std::make_pair(meritsFlawName, number));
}
/** Implementation of the getDescription method.
*
* Implementation of the getDescription method
* getDescription method allows to return the description of
* a merit or a flow
*
* @param table: name of the table to look for a merit or flaw
* @param attributeName: name of the merit to return the description
*/
std::string vampireGameproject::Meritsflaws::getDescription(std::string table, std::string attributeName){
return textParser.parseText("Merits_flaws", table, attributeName);
}