-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPicturemodifying.cpp
More file actions
445 lines (327 loc) · 17.6 KB
/
Copy pathPicturemodifying.cpp
File metadata and controls
445 lines (327 loc) · 17.6 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
/**
* @file Picturemodifying.cpp
*
* @brief File containing source code of the Picturesmodifying class
*
*
* @author Hugo MARTIN
* Contact: hugo.martin.1@etu.univ-amu.fr
*
*/
#include "classes.h"
/** Constructor of the class Picturemodifying.
*
* Modification of the constructor of Picturemodifying
* Giving a reference of Character object before the
* initialisation of constructor
*
*/
vampireGameproject::Picturemodifying::Picturemodifying(Character& ReferenceCharacter): CharacterReference(ReferenceCharacter){}
/** Destructor of the class Picturemodifying.
*
* Modification of the destructor of Picturemodifying
*
*
*
*/
vampireGameproject::Picturemodifying::~Picturemodifying(){}
/** Implementation of the writeResultsAttributes method.
*
* Implementation of the writeResultsAttributes method
* Method writting the Attributes choices in the output
* file
*
* @param fileToWrite: reference of the output file to write the contain */
void vampireGameproject::Picturemodifying::writeResultsAttributes(std::ofstream& fileToWrite){
fileToWrite << "<--------------------------------------------Attributes---------------------------------------->" << std::endl;
fileToWrite << "Physical\tSocial\t\t\tMental" << std::endl;
std::map<std::string, int> physicalAttributes = CharacterReference.getAttributes("Physical");
std::map<std::string, int> socialAttributes = CharacterReference.getAttributes("Social");
std::map<std::string, int> mentalAttributes = CharacterReference.getAttributes("Mental");
std::string tableAttributes[] = {"Strength", "Charisma",
"Perception", "Dexterity", "Manipulation",
"Intelligence", "Stamina", "Appearance", "Wits"};
int tableAttributesSize = 9;
std::map<std::string, int>::iterator iteratorMap;
/*We iterate on all the tableAttributes, and according to the index,
of the item, this one is a part of a some categorie (Physical, Social, Mental) */
for(int iterator = 0; iterator < tableAttributesSize; iterator++){
if (iterator % 3 == 0){
iteratorMap = physicalAttributes.find(tableAttributes[iterator]);
if(iteratorMap != physicalAttributes.end()){
fileToWrite << tableAttributes[iterator] << ":" << iteratorMap->second << "\t";
}
else{
fileToWrite << tableAttributes[iterator] << ": 0" << "\t";
}
}
if ((iterator - 1) % 3 == 0){
iteratorMap = socialAttributes.find(tableAttributes[iterator]);
if (iteratorMap != socialAttributes.end()){
fileToWrite << tableAttributes[iterator] << ":" << iteratorMap->second << "\t";
}
else{
fileToWrite << tableAttributes[iterator] << ": 0" << "\t";
}
}
if((iterator - 2) % 3 == 0){
iteratorMap = mentalAttributes.find(tableAttributes[iterator]);
if(iteratorMap != mentalAttributes.end()){
fileToWrite << "\t" << tableAttributes[iterator] << ":" << iteratorMap->second << "\n";
}
else{
fileToWrite << "\t" << tableAttributes[iterator] << ": 0" << "\n";
}
}
}
}
/** Implementation of the writeResultsAbilities method.
*
* Implementation of the writeResultsAbilities method
* Method writting the Abilities choices in the output
* file
*
* @param fileToWrite: reference of the output file to write the contain */
void vampireGameproject::Picturemodifying::writeResultsAbilities(std::ofstream& fileToWrite){
fileToWrite << "\n";
fileToWrite << "<------------------------------------------Abilities------------------------------------------->" << std::endl;
fileToWrite << "Talents\tSkills\t\tKnowledges" << std::endl;
std::string tableAbilities[] = {"Alertness", "Animal Ken",
"Academics", "Athletics", "Crafts", "Computer", "Awareness",
"Drive", "Finance", "Brawl", "Etiquette", "Investigation",
"Empathy", "Firearms", "Law", "Expression", "Larceny",
"Medicine", "Intimidation", "Melee", "Occult",
"Leadership", "Performance", "Politics",
"Streetwise", "Stealth", "Science",
"Subterfuge", "Survival", "Technology"};
int tableAbilitiesSize = 30;
std::map<std::string, int> talentsAbilities = CharacterReference.getAbilties("talents");
std::map<std::string, int> skillsAbilities = CharacterReference.getAbilties("skills");
std::map<std::string, int> knowledgesAbilities = CharacterReference.getAbilties("knowledges");
std::map<std::string, int>::iterator iteratorMap;
/*We iterate on all the tableAbilities, and according to the index,
of the item, this one is a part of a some categorie (Talents, Skills, Knowledges) */
for(int iterator = 0; iterator < tableAbilitiesSize; iterator++){
if (iterator % 3 == 0){
iteratorMap = talentsAbilities.find(tableAbilities[iterator]);
if(iteratorMap != talentsAbilities.end()){
fileToWrite << tableAbilities[iterator] << ":" << iteratorMap->second << "\t";
}
else{
fileToWrite << tableAbilities[iterator] << ": 0" << "\t";
}
}
if ((iterator - 1) % 3 == 0){
iteratorMap = skillsAbilities.find(tableAbilities[iterator]);
if (iteratorMap != skillsAbilities.end()){
fileToWrite << tableAbilities[iterator] << ":" << iteratorMap->second << "\t";
}
else{
fileToWrite << tableAbilities[iterator] << ": 0" << "\t";
}
}
if((iterator - 2) % 3 == 0){
iteratorMap = knowledgesAbilities.find(tableAbilities[iterator]);
if(iteratorMap != knowledgesAbilities.end()){
fileToWrite << tableAbilities[iterator] << ":" << iteratorMap->second << "\n";
}
else{
fileToWrite << tableAbilities[iterator] << ": 0" << "\n";
}
}
}
}
/** Implementation of the writeResultsAdvantages method.
*
* Implementation of the writeResultsAdvantages method
* Method writting the Advantages choices in the output
* file
*
* @param fileToWrite: reference of the output file to write the contain */
void vampireGameproject::Picturemodifying::writeResultsAdvantages(std::ofstream& fileToWrite){
fileToWrite << "\n";
fileToWrite << "<-------------------------------------------Advantages----------------------------------------->" << std::endl;
std::vector<MultiDimensionnalDataStructure*> DisciplinesVector = CharacterReference.returnDisciplines();
std::map<std::string, int> backgroundMap = CharacterReference.getBackground();
std::map<std::string, int> virtuesMap = CharacterReference.getVirtues();
std::map<std::string, int> DisciplinesDictionnary;
for(int iterator = 0; iterator < (int)DisciplinesVector.size(); iterator++){
if (iterator % 3 == 0){
if (DisciplinesDictionnary.find(DisciplinesVector[iterator]->categorie) == DisciplinesDictionnary.end()){
DisciplinesDictionnary.insert(std::pair<std::string, int>(DisciplinesVector[iterator]->categorie, DisciplinesVector[iterator + 2]->value));
}
else{
DisciplinesDictionnary[DisciplinesVector[iterator]->categorie] += DisciplinesVector[iterator + 2]->value;
}
}
}
fileToWrite << "Disciplines" << std::endl;
std::map<std::string, int>::iterator mapIterator;
for(mapIterator = DisciplinesDictionnary.begin(); mapIterator != DisciplinesDictionnary.end(); mapIterator++){
fileToWrite << mapIterator->first << ":" << mapIterator->second << "\n";
}
fileToWrite << "\n";
fileToWrite << "Backgrounds" << std::endl;
for(mapIterator = backgroundMap.begin(); mapIterator != backgroundMap.end(); mapIterator++){
fileToWrite << mapIterator->first << ":" << mapIterator->second << "\n";
}
fileToWrite << "\n";
fileToWrite << "Virtues" << std::endl;
for(mapIterator = virtuesMap.begin(); mapIterator != virtuesMap.end(); mapIterator++){
fileToWrite << mapIterator->first << ":" << mapIterator->second << "\n";
}
fileToWrite << "<---------------------------------------------------------------------------------------------->" << std::endl;
}
/** Implementation of the writeResultsHumanityPathToHealth method.
*
* Implementation of the writeResultsHumanityPathToHealth method
* Method writting the HumanityPath until Health choices in the output
* file
*
* @param fileToWrite: reference of the output file to write the contain */
void vampireGameproject::Picturemodifying::writeResultsHumanityPathToHealth(std::ofstream& fileToWrite){
fileToWrite << "\t<-------Humanity/Path------>\t<-------Health--------->" << std::endl;
std::string HumanityPath = CharacterReference.getHumanity();
std::string Willpower = CharacterReference.getWillpower();
float bloodPool = CharacterReference.getBloodpool();
std::string health = CharacterReference.getHealth();
fileToWrite << "\t\t" << HumanityPath << "\t\t\t" << health << std::endl;
fileToWrite << "\t<-------Willpower---------->" << std::endl;
fileToWrite << "\t\t" << Willpower << std::endl;
fileToWrite << "\t" << "<-------Blood pool--------->" << std::endl;
fileToWrite << "\t\t" << bloodPool << "\t\t\t" << "<--------Weakness------->" << std::endl;
fileToWrite << "\n";
fileToWrite << "\t\t\t\t\t<-------Experience------>\n" << std::endl;
}
/** Implementation of the writeResultsMeritsFlaws method.
*
* Implementation of the writeResultsMeritsFlaws method
* Method writting the MeritsFlaws choices in the output
* file
*
* @param fileToWrite: reference of the output file to write the contain */
void vampireGameproject::Picturemodifying::writeResultsMeritsFlaws(std::ofstream& fileToWrite){
fileToWrite << "<---------------------------------------Merits & Flaws----------------------------------------->" << std::endl;
fileToWrite << "Merit&Flaws\tType\t\tCost" << std::endl;
std::map<std::string, int> physicalMeritsFlaws = CharacterReference.returnMeritsFlaws("Physical");
std::map<std::string, int> mentalMeritsFlaws = CharacterReference.returnMeritsFlaws("Mental");
std::map<std::string, int> socialMeritsFlaws = CharacterReference.returnMeritsFlaws("Social");
std::map<std::string, int> supernaturalMeritsFlaws = CharacterReference.returnMeritsFlaws("Supernatural");
std::map<std::string, int>::iterator iteratorMap;
if (!physicalMeritsFlaws.empty()){
for(iteratorMap = physicalMeritsFlaws.begin(); iteratorMap!= physicalMeritsFlaws.end(); iteratorMap++){
fileToWrite << "Physical" << "\t\t" << iteratorMap->first << "\t\t" << iteratorMap->second << std::endl;
}
}
if (!mentalMeritsFlaws.empty()){
for(iteratorMap = mentalMeritsFlaws.begin(); iteratorMap!= mentalMeritsFlaws.end(); iteratorMap++){
fileToWrite << "Mental" << "\t\t" << iteratorMap->first << "\t\t" << iteratorMap->second << std::endl;
}
}
if (!socialMeritsFlaws.empty()){
for(iteratorMap = socialMeritsFlaws.begin(); iteratorMap!= socialMeritsFlaws.end(); iteratorMap++){
fileToWrite << "Social" << "\t\t" << iteratorMap->first << "\t\t" << iteratorMap->second << std::endl;
}
}
if (!supernaturalMeritsFlaws.empty()){
for(iteratorMap = supernaturalMeritsFlaws.begin(); iteratorMap!= supernaturalMeritsFlaws.end(); iteratorMap++){
fileToWrite << "Supernatural" << "\t\t" << iteratorMap->first << "\t\t" << iteratorMap->second << std::endl;
}
}
}
/** Implementation of the writeResultsOthersCaracteristics method.
*
* Implementation of the writeResultsOthersCaracteristics method
* Method writting the other characteristics choices in the output
* file
*
* @param fileToWrite: reference of the output file to write the contain */
void vampireGameproject::Picturemodifying::writeResultsOthersCaracteristics(std::ofstream& fileToWrite){
fileToWrite << "<-----------------------------------------Other Traits----------------------------------------->" << std::endl;
fileToWrite << "\n\n";
fileToWrite << "<--------Rituals-----------------------------------------------------------------Paths--------->" << std::endl;
fileToWrite << "Name\tLevel\t" << std::endl;
fileToWrite << "\n\n\n\n";
fileToWrite << "<------------Experiance-------------------------------------------------Derangements----------->" << std::endl;
fileToWrite << "Total:" << std::endl;
fileToWrite << "Total Spent:" << std::endl;
fileToWrite << "Spent On:" << std::endl;
fileToWrite << "\n\n\n";
fileToWrite << "<-----------------------------------------Combat----------------------------------------------->" << std::endl;
fileToWrite << "____________________________________________________________________________________" << std::endl;
fileToWrite << "Weapon/Attack\tDiff.\tDamage\tRane\tRate\tClip\tConceal\tArmor" << std::endl;
fileToWrite << "____________________________________________________________________________________" << std::endl;
fileToWrite << "____________________________________________________________________________________\tClass:" << std::endl;
fileToWrite << "____________________________________________________________________________________\tRating:" << std::endl;
fileToWrite << "____________________________________________________________________________________\tPenality:" << std::endl;
fileToWrite << "____________________________________________________________________________________\tDescription:" << std::endl;
for(int iterator = 0; iterator < 3; iterator++){
fileToWrite << "____________________________________________________________________________________" << std::endl;
}
fileToWrite << "<------------------------------------Expanded Backgrounds-------------------------------------->" << std::endl;
fileToWrite << "\tAllies\t\t\t\t\t\t\tMentor" << std::endl;
fileToWrite << "\n\n" << std::endl;
fileToWrite << "\tContacts\t\t\t\t\t\tResources" << std::endl;
fileToWrite << "\n\n" << std::endl;
fileToWrite << "\tFame\t\t\t\t\t\t\tRetainers" << std::endl;
fileToWrite << "\n\n" << std::endl;
fileToWrite << "\tHerd\t\t\t\t\t\t\tStatus" << std::endl;
fileToWrite << "\n\n" << std::endl;
fileToWrite << "\tInfluence\t\t\t\t\t\tOther()" << std::endl;
fileToWrite << "\n\n" << std::endl;
fileToWrite << "<---------------------------------------Possessions-------------------------------------------->" << std::endl;
fileToWrite << "\tGear(Carried)\t\t\t\tEquipment(Owned)" << std::endl;
fileToWrite << "\n\n" << std::endl;
fileToWrite << "\tFeeding Grounds\t\t\tVehicles" << std::endl;
fileToWrite << "<-----------------------------------Blood Bonds/Vinculi---------------------------------------->" << std::endl;
fileToWrite << "Bound To\tRating\t\tBound To\tRating" << std::endl;
fileToWrite << "\n\n" << std::endl;
fileToWrite << "<-------------------------------------------Havens--------------------------------------------->" << std::endl;
fileToWrite << "Location\tDescription" << std::endl;
fileToWrite << "\n\n" << std::endl;
fileToWrite << "<--------------------------------------------History------------------------------------------->" << std::endl;
fileToWrite << "\t\t\t\t\t\tPrelude" << std::endl;
fileToWrite << "\n\n";
fileToWrite << "\t\t\t\t\t\tGoals" << std::endl;
fileToWrite << "\n\n";
fileToWrite << "<------------------------------------------Description----------------------------------------->" << std::endl;
fileToWrite << "Age:" << std::endl;
fileToWrite << "Apparent Age:" << std::endl;
fileToWrite << "Date of Birth:" << std::endl;
fileToWrite << "R.I.P:" << std::endl;
fileToWrite << "Hair:" << std::endl;
fileToWrite << "Eyes:" << std::endl;
fileToWrite << "Race:" << std::endl;
fileToWrite << "Nationality:" << std::endl;
fileToWrite << "Height:" << std::endl;
fileToWrite << "Weight:" << std::endl;
fileToWrite << "Sex:" << std::endl;
fileToWrite << "<-------------------------------------------Visuals-------------------------------------------->" << std::endl;
fileToWrite << "\tCoterie Chat\t\t\t\t\t\t\tCharacterSketch" << std::endl;
}
/** Implementation of the writeResultsFile method.
*
* Implementation of the writeResultsFile method
* Method writting the user choices in the output
* file
*
* @param filename: filename to save the output file*/
void vampireGameproject::Picturemodifying::writeResultsFile(std::string filename){
std::ofstream outfile(filename);
outfile << "\t\t\t20th Anniversary Edition" << std::endl;
outfile << "\t\t\tVAMPIRE" << std::endl;
outfile << "\t\t\tThe Masquerade\n" << std::endl;
outfile << "Name:" << CharacterReference.returnVampireNickName() << "\tNature:";
outfile << CharacterReference.getNature() << "\tClan:" << CharacterReference.getClan() << std::endl;
outfile << "Player:" << CharacterReference.getPlayername() << "\t\tDemeanor:" << CharacterReference.getNature();
outfile << "\t\tGeneration:" << CharacterReference.getGeneration() << std::endl;
outfile << "Chronicle:" << "\t\t" << "Concept:" << "\t\t" << "Sire:" << std::endl;
outfile << "\n";
writeResultsAttributes(outfile);
writeResultsAbilities(outfile);
writeResultsAdvantages(outfile);
writeResultsHumanityPathToHealth(outfile);
writeResultsMeritsFlaws(outfile);
writeResultsOthersCaracteristics(outfile);
outfile.close();
}