Adds convenience functions to abilities.
This commit is contained in:
@@ -29,6 +29,16 @@ void FillAbilities(vector<AbilityType>& abilities) {
|
|||||||
abilities.push_back(kAbilityGroupKnowledges);
|
abilities.push_back(kAbilityGroupKnowledges);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vector<string> GetAbilityGroupPluralLabels() {
|
||||||
|
vector<string> labels;
|
||||||
|
|
||||||
|
for (int id = 1; id <= kAbilitiesCount; id++) {
|
||||||
|
labels.push_back(GetAbility(id).plural);
|
||||||
|
}
|
||||||
|
|
||||||
|
return labels;
|
||||||
|
}
|
||||||
|
|
||||||
void FillAbilitiesForAbilityGroup(vector<string>& abilities, int id) {
|
void FillAbilitiesForAbilityGroup(vector<string>& abilities, int id) {
|
||||||
abilities.clear();
|
abilities.clear();
|
||||||
int numAbilities = GetNumItemsForAbilityGroup(id);
|
int numAbilities = GetNumItemsForAbilityGroup(id);
|
||||||
@@ -51,6 +61,17 @@ void FillAbilitiesForAbilityGroup(vector<string>& abilities, int id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vector<string> GetAbilityLabelsForAbilityGroup(int group_id) {
|
||||||
|
vector<string> labels;
|
||||||
|
|
||||||
|
int count = GetNumItemsForAbilityGroup(group_id);
|
||||||
|
for (int id = 1; id <= count; id++) {
|
||||||
|
labels.push_back(GetAbilityLabel(group_id, id));
|
||||||
|
}
|
||||||
|
|
||||||
|
return labels;
|
||||||
|
}
|
||||||
|
|
||||||
void FillAbilityLabels(vector<string>& labels, int id) {
|
void FillAbilityLabels(vector<string>& labels, int id) {
|
||||||
labels.clear();
|
labels.clear();
|
||||||
switch (id) {
|
switch (id) {
|
||||||
|
|||||||
@@ -189,12 +189,16 @@ bool operator!=(const AbilityType& left, const AbilityType& right);
|
|||||||
/// @param abilities The vector to fill.
|
/// @param abilities The vector to fill.
|
||||||
void FillAbilities(std::vector<AbilityType>& abilities);
|
void FillAbilities(std::vector<AbilityType>& abilities);
|
||||||
|
|
||||||
|
std::vector<std::string> GetAbilityGroupPluralLabels();
|
||||||
|
|
||||||
/// @brief Fills the provided vector with all of the ability labels in the specified group. It will be cleared before
|
/// @brief Fills the provided vector with all of the ability labels in the specified group. It will be cleared before
|
||||||
/// filling.
|
/// filling.
|
||||||
/// @param abilities The vector to fill.
|
/// @param abilities The vector to fill.
|
||||||
/// @param id The id of the ability group to fill for.
|
/// @param id The id of the ability group to fill for.
|
||||||
void FillAbilitiesForAbilityGroup(std::vector<std::string>& abilities, int id);
|
void FillAbilitiesForAbilityGroup(std::vector<std::string>& abilities, int id);
|
||||||
|
|
||||||
|
std::vector<std::string> GetAbilityLabelsForAbilityGroup(int group_id);
|
||||||
|
|
||||||
/// @brief Fills the provided vector with all of the ability labels in the specified group. It will be cleared before
|
/// @brief Fills the provided vector with all of the ability labels in the specified group. It will be cleared before
|
||||||
/// filling.
|
/// filling.
|
||||||
/// @param labels The vector to fill.
|
/// @param labels The vector to fill.
|
||||||
|
|||||||
Reference in New Issue
Block a user