Removes FillDerangements.
Refactors GetAllDerangementsLine to be simpler.
This commit is contained in:
@@ -1,11 +1,17 @@
|
|||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "Attributes.h"
|
#include "Attributes.h"
|
||||||
|
|
||||||
namespace SBF {
|
namespace SBF {
|
||||||
|
namespace {
|
||||||
|
using std::ostringstream;
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
} // namespace
|
||||||
|
|
||||||
CharacterType::CharacterType() {
|
CharacterType::CharacterType() {
|
||||||
// Scalars
|
// Scalars
|
||||||
@@ -711,20 +717,9 @@ void NewDerangement(DerangementType& derangement, int id, string label, int text
|
|||||||
}
|
}
|
||||||
|
|
||||||
string CharacterType::GetAllDerangementsLine() const {
|
string CharacterType::GetAllDerangementsLine() const {
|
||||||
// TODO: Replace this with a stringstream.
|
|
||||||
std::vector<DerangementType> allDerangements;
|
|
||||||
FillDerangements(allDerangements);
|
|
||||||
string allDerangementsString = "";
|
|
||||||
std::for_each(allDerangements.begin(), allDerangements.end(), [&allDerangementsString](DerangementType derangement) {
|
|
||||||
allDerangementsString += derangement.label + ", ";
|
|
||||||
});
|
|
||||||
return allDerangementsString;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CharacterType::FillDerangements(std::vector<DerangementType> derangements) const {
|
|
||||||
derangements.clear();
|
|
||||||
if (derangementId > 0) {
|
if (derangementId > 0) {
|
||||||
derangements[0] = kDerangements[derangementId];
|
return GetDerangement(derangementId).label;
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
} // End namespace SBF
|
} // End namespace SBF
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ class CharacterType {
|
|||||||
void FillAttributeValues(std::vector<int> attributeValues, int groupId) const;
|
void FillAttributeValues(std::vector<int> attributeValues, int groupId) const;
|
||||||
void FillBackgroundValues(std::vector<int> backgroundValues) const;
|
void FillBackgroundValues(std::vector<int> backgroundValues) const;
|
||||||
void FillDisciplineValues(std::vector<int> disciplineValues) const;
|
void FillDisciplineValues(std::vector<int> disciplineValues) const;
|
||||||
void FillDerangements(std::vector<DerangementType> derangements) const;
|
|
||||||
void FillVirtueValues(std::vector<int> virtueValues) const;
|
void FillVirtueValues(std::vector<int> virtueValues) const;
|
||||||
int GetAbilityValue(int abilityGroupId, int abilityId) const;
|
int GetAbilityValue(int abilityGroupId, int abilityId) const;
|
||||||
int GetAttributeValue(int attributeGroupId, int abilityId) const;
|
int GetAttributeValue(int attributeGroupId, int abilityId) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user