diff --git a/sbf-cpp/Abilities.cpp b/sbf-cpp/Abilities.cpp index 618e744..c360f7f 100644 --- a/sbf-cpp/Abilities.cpp +++ b/sbf-cpp/Abilities.cpp @@ -7,10 +7,10 @@ namespace SBF { using std::ostream; using std::vector; - ostream& operator<<(ostream& os, const AbilityType& abilityGroup) { - os << "AbilityGroup: {id: " << abilityGroup.id - << ", singular: \"" << abilityGroup.singular - << "\", plural: \"" << abilityGroup.plural << "\"}"; + ostream& operator<<(ostream& os, const AbilityType& ability) { + os << "AbilityGroup: {id: " << ability.id + << ", singular: \"" << ability.singular + << "\", plural: \"" << ability.plural << "\"}"; return os; } @@ -31,10 +31,10 @@ namespace SBF { abilities.push_back(kAbilityGroupKnowledges); } - void FillAbilitiesForAbilityGroup(vector& abilities, int abilityGroupId) { + void FillAbilitiesForAbilityGroup(vector& abilities, int id) { abilities.clear(); - int numAbilities = GetNumItemsForAbilityGroup(abilityGroupId); - switch (abilityGroupId) { + int numAbilities = GetNumItemsForAbilityGroup(id); + switch (id) { case kAbilityTalentsId: for (int talentId = 0; talentId <= numAbilities; talentId++) { if (talentId >= 0 && talentId <= kTalentsCount) { @@ -59,9 +59,9 @@ namespace SBF { } } - void FillAbilityLabels(vector& labels, int abilityGroupId) { + void FillAbilityLabels(vector& labels, int id) { labels.clear(); - switch (abilityGroupId) { + switch (id) { case kAbilityTalentsId: FillTalentLabels(labels); break; diff --git a/sbf-cpp/Abilities.h b/sbf-cpp/Abilities.h index 139a778..8cbe2ae 100644 --- a/sbf-cpp/Abilities.h +++ b/sbf-cpp/Abilities.h @@ -47,6 +47,8 @@ namespace SBF { kAbilityGroupKnowledges, }; + const std::string kAbilityUnknownLabel = ""; + const int kTalentActingId = 1; const std::string kTalentActingLabel = "Acting"; const int kTalentAlertnessId = 2; @@ -69,7 +71,7 @@ namespace SBF { const std::string kTalentSubterfugeLabel = "Subterfuge"; const int kTalentsCount = 10; const std::string kTalents[] = { - "", + kAbilityUnknownLabel, kTalentActingLabel, kTalentAlertnessLabel, kTalentAthleticsLabel, @@ -104,7 +106,7 @@ namespace SBF { const std::string kSkillSurvivalLabel = "Survival"; const int kSkillsCount = 10; const std::string kSkills[] = { - "", + kAbilityUnknownLabel, kSkillAnimalKenLabel, kSkillDriveLabel, kSkillEtiquetteLabel, @@ -139,7 +141,7 @@ namespace SBF { const std::string kKnowledgeScienceLabel = "Science"; const int kKnowledgesCount = 10; const std::string kKnowledges[] = { - "", + kAbilityUnknownLabel, kKnowledgeBureaucracyLabel, kKnowledgeComputerLabel, kKnowledgeFinanceLabel, @@ -154,9 +156,9 @@ namespace SBF { /// @brief This function writes an AbilityType value to an output stream; /// @param os The output stream to write to. - /// @param abilityGroup The AbilityType to write. + /// @param group The AbilityType to write. /// @return Thw output stream for chaining. - std::ostream& operator<<(std::ostream& os, const AbilityType& abilityGroup); + std::ostream& operator<<(std::ostream& os, const AbilityType& group); /// @brief This function compares two AbilityType values for equality. /// @param left The first AbilityType. @@ -176,56 +178,56 @@ namespace SBF { /// @brief Fills the provided vector with all of the ability labels in the specified group. It will be cleared before filling. /// @param abilities The vector to fill. - /// @param abilityGroupId The id of the ability group to fill for. - void FillAbilitiesForAbilityGroup(std::vector& abilities, int abilityGroupId); + /// @param id The id of the ability group to fill for. + void FillAbilitiesForAbilityGroup(std::vector& abilities, int id); /// @brief Fills the provided vector with all of the ability labels in the specified group. It will be cleared before filling. /// @param labels The vector to fill. - /// @param abilityGroupId The id of the ability group to fill for. - void FillAbilityLabels(std::vector& labels, int abilityGroupId); + /// @param id The id of the ability group to fill for. + void FillAbilityLabels(std::vector& labels, int id); /// @brief Fills the provided vector with all of the knowledge labels. It will be cleared before filling. - /// @param knowledgeLabels The vector to fill. - void FillKnowledgeLabels(std::vector& knowledgeLabels); + /// @param labels The vector to fill. + void FillKnowledgeLabels(std::vector& labels); /// @brief Fills the provided vector with all of the skill labels. It will be cleared before filling. - /// @param skillLabels The vector to fill. - void FillSkillLabels(std::vector& skillLabels); + /// @param labels The vector to fill. + void FillSkillLabels(std::vector& labels); /// @brief Fills the provided vector with all of the talent labels. It will be cleared before filling. - /// @param talentLabels The vector to fill. - void FillTalentLabels(std::vector& talentLabels); + /// @param labels The vector to fill. + void FillTalentLabels(std::vector& labels); /// @brief Gets an ability group for a given id. - /// @param abilityGroupId The id of the ability group to return. - /// @return The ability group with an id of abilityGroupId. - const AbilityType& GetAbility(int abilityGroupId); + /// @param id The id of the ability group to return. + /// @return The ability group with an id of id or kAbilityGroupUnknown if id is invalid. + const AbilityType& GetAbility(int id); /// @brief Gets the label for an ability given its ability group (talents/skills/knowledges) and its id (acting, brawl, dodge, ...). - /// @param abilityGroupId The id for the ability group (talents/skills/knowledges). - /// @param abilityId The id for the ability within the ability group (acting, dodge, brawl, ...). + /// @param group_id The id for the ability group (talents/skills/knowledges). + /// @param id The id for the ability within the ability group (acting, dodge, brawl, ...). /// @return The label for the specific ability ("Acting"). - const std::string GetAbilityLabel(int abilityGroupId, int abilityId); + const std::string GetAbilityLabel(int group_id, int id); /// @brief Gets the label for a knowledge ability given its id. - /// @param knowledgeId The id of the ability to return the label for. + /// @param id The id of the ability to return the label for. /// @return The label for the specific ability. - const std::string GetKnowledgeLabel(int talentId); + const std::string GetKnowledgeLabel(int id); /// @brief Gets the number of abilities in an ability group. - /// @param abilityGroupId The id of the ability group to return the number of abilities for. + /// @param id The id of the ability group to return the number of abilities for. /// @return The number of abilities in the specific ability group. - int GetNumItemsForAbilityGroup(int abilityGroupId); + int GetNumItemsForAbilityGroup(int id); /// @brief Gets the label for a skill ability given its id. - /// @param talentId The id of the ability to return the label for. + /// @param id The id of the ability to return the label for. /// @return The label of the specific ability. - const std::string GetSkillLabel(int talentId); + const std::string GetSkillLabel(int id); /// @brief Gets the label for a talent ability given its id. - /// @param talentId The id of the ability to return. + /// @param id The id of the ability to return. /// @return The label for the specific ability. - const std::string GetTalentLabel(int talentId); + const std::string GetTalentLabel(int id); } // End namespace SBF /** @}*/ #endif // End !defined ABILITIES_H__ diff --git a/sbf-cpp/Attributes.h b/sbf-cpp/Attributes.h index 5e16ff1..ca84658 100644 --- a/sbf-cpp/Attributes.h +++ b/sbf-cpp/Attributes.h @@ -99,33 +99,77 @@ namespace SBF { }; /// @brief Gets the label for the attribute group with the specified id. - /// @param attributeGroupId The id of the attribute group to return the label for. + /// @param attribute_group_id The id of the attribute group to return the label for. /// @return The label of the specified attribute group. - std::string GetAttributeGroupLabel(int attributeGroupId); + std::string GetAttributeGroupLabel(int attribute_group_id); - /// @brief Gets the label for the attribute with the specified group id an attribute id. - /// @param attributeGroupId The id of the attribute group to return the label for. - /// @param attributeId The id of the attribute withing the group to return the label for. - /// @return The label of the specified attribute. - std::string GetAttributeLabel(int attributeGroupId, int attributeId); + /// @brief Gets the label for the attribute with a specific pair of group and attribute ids. + /// @param attribute_group_id The id of the attribute group to get the label for. + /// @param attribute_id The id of the attribute within the group to return the label for. + /// @return The label of the specified attribute or an empty string if either id is invalid. + std::string GetAttributeLabel(int attribute_group_id, int attribute_id); - /// @brief - /// @param attributeGroupId - /// @param attributeId - /// @return - std::string GetAttributeLabelAbbreviation(int attributeGroupId, int attributeId); - std::string GetPhysicalAttributeLabel(int attributeId); - std::string GetPhysicalAttributeLabelAbbreviation(int attributeId); - int GetNumAttributesInGroup(int attributeGroupId); - std::string GetSocialAttributeLabel(int attributeId); - std::string GetSocialAttributeLabelAbbreviation(int attributeId); - std::string GetMentalAttributeLabel(int attributeId); - std::string GetMentalAttributeLabelAbbreviation(int attributeId); - void FillAttributeGroupLabels(std::vector& attributeGroupLabels); - void FillAttributeLabelsInGroup(std::vector& attributeLabels, int groupId); - void FillPhysicalAttributeLabels(std::vector& physicalAttributeLabels); - void FillSocialAttributeLabels(std::vector& socialAttributeLabels); - void FillMentalAttributeLabels(std::vector& mentalAttributeLabels); + /// @brief Gets the label abbreviation for the attribute with a specific pair of group and attribute ids. + /// @param attribute_group_id The id of the attribute group to get the label abbreviation for. + /// @param attribute_id The id of the attribute within the group to return the label abbreviation for. + /// @return The label abbreviation of the specified attribute or an empty string if either id is invalid. + std::string GetAttributeLabelAbbreviation(int attribute_group_id, int attribute_id); + + /// @brief Gets the label for the physical attribute with a specific id. + /// @param attribute_id The id of the physical attribute to get the label for. + /// @return The label of the specified attribute or an empty string if the id is invalid. + std::string GetPhysicalAttributeLabel(int attribute_id); + + /// @brief Gets the label abbreviation for the physical attribute with a specific id. + /// @param attribute_id The id of the physical attribute to get the label abbreviation for. + /// @return The label abbreviation of the specified attribute or an empty string if the id is invalid. + std::string GetPhysicalAttributeLabelAbbreviation(int attribute_id); + + /// @brief Gets the number of attributes in a specific attribute group. + /// @param attribute_group_id The id of the attribute group. + /// @return The number of attributes in the specified group or 0 if the id is invalid. + int GetNumAttributesInGroup(int attribute_group_id); + + /// @brief Gets the label for the social attribute with a specific id. + /// @param attribute_id The id of the social attribute to get the label for. + /// @return The label of the specified attribute or an empty string if the id is invalid. + std::string GetSocialAttributeLabel(int attribute_id); + + /// @brief Gets the label abbreviation for the social attribute with a specific id. + /// @param attribute_id The id of the social attribute to get the label abbreviation for. + /// @return The label abbreviation of the specified attribute or an empty string if the id is invalid. + std::string GetSocialAttributeLabelAbbreviation(int attribute_id); + + /// @brief Gets the label for the mental attribute with a specific id. + /// @param attribute_id The id of the mental attribute to get the label for. + /// @return The label of the specified attribute or an empty string if the id is invalid. + std::string GetMentalAttributeLabel(int attribute_id); + + /// @brief Gets the label abbreviation for the mental attribute with a specific id. + /// @param attribute_id The id of the mental attribute to get the label abbreviation for. + /// @return The label abbreviation of the specified attribute or an empty string if the id is invalid. + std::string GetMentalAttributeLabelAbbreviation(int attribute_id); + + /// @brief Fills the provided vector with all of the valid attribute group labels + /// @param labels The vector to fill. It will be cleared first. + void FillAttributeGroupLabels(std::vector& labels); + + /// @brief Fills the provided vector with all of the valid attribute labels in a specific group. + /// @param labels The vector to fill. It will be cleared first. + /// @param group_id The group to fill attribute labels for. + void FillAttributeLabelsInGroup(std::vector& labels, int group_id); + + /// @brief Fills the provided vector with all of the valid physical attribute labels. + /// @param labels The vector to fill. It will be cleared first. + void FillPhysicalAttributeLabels(std::vector& labels); + + /// @brief Fills the provided vector with all of the valid social attribute labels. + /// @param labels The vector to fill. It will be cleared first. + void FillSocialAttributeLabels(std::vector& labels); + + /// @brief Fills the provided vector with all of the valid mental attribute labels. + /// @param labels The vector to fill. It will be cleared first. + void FillMentalAttributeLabels(std::vector& labels); } // End namespace SBF /** @}*/ #endif // End !defined ATTRIBUTES_H__ diff --git a/sbf-cpp/Backgrounds.h b/sbf-cpp/Backgrounds.h index c4329d0..387d56d 100644 --- a/sbf-cpp/Backgrounds.h +++ b/sbf-cpp/Backgrounds.h @@ -50,8 +50,15 @@ namespace SBF { kBackgroundRetainersLabel, kBackgroundStatusLabel, }; - std::string GetBackgroundLabel(int backgroundId); - void FillBackgroundLabels(std::vector& backgroundLabels); + + /// @brief Gets the label for a background with a specific id. + /// @param background_id The id of the background to get the label for. + /// @return The label for the specified background or an empty string if background_id is invalid. + std::string GetBackgroundLabel(int background_id); + + /// @brief Fills the provided vector with all valid background labels. + /// @param background_labels The vector to fill. It will be emptied first. + void FillBackgroundLabels(std::vector& background_labels); } // End namespace SBF /** @}*/ #endif // End !defined BACKGROUNDS_H__ diff --git a/sbf-cpp/Clans.h b/sbf-cpp/Clans.h index 65853f4..bb1c010 100644 --- a/sbf-cpp/Clans.h +++ b/sbf-cpp/Clans.h @@ -73,7 +73,14 @@ namespace SBF { kClanTzismiceLabel, kClanVentrueLabel, }; - std::string GetClanLabel(int clanId); + + /// @brief Gets the label for a clan with a specific id. + /// @param clan_id The id of the clan to get the label for. + /// @return The label of the specified clan or an empty string if clan_id is invalid. + std::string GetClanLabel(int clan_id); + + /// @brief Fills the provided vector with all valid clans. + /// @param clans The vector to fill. It will be emptied first. void FillClanLabels(std::vector& clans); } // End namespace SBF /** @}*/ diff --git a/sbf-cpp/Derangements.h b/sbf-cpp/Derangements.h index 48acef6..6bd6418 100644 --- a/sbf-cpp/Derangements.h +++ b/sbf-cpp/Derangements.h @@ -63,6 +63,7 @@ namespace SBF { const uint8_t kDerangementRegressionTextColor= kColorBrightYellow; const std::string kDerangementRegressionLabel = "Regression"; const std::string kDerangementRegressionDescription = R"---(You become childlike retreating to an earlier time when less was expected of you Willpower is regained inthe way a Child's is.)---"; + const DerangementType kDerangementUnknown = {0, "", "", 0}; const DerangementType kDerangementAmnesia = { kDerangementAmnesiaId, kDerangementAmnesiaLabel, @@ -181,10 +182,31 @@ namespace SBF { kDerangementRegression, }; + /// @brief Determines the equality of two derangements. + /// @param left A derangement to compare. + /// @param right A derangement to compare. + /// @return True if the derangements are equal and false otherwise. bool operator==(const DerangementType& left, const DerangementType& right); + + /// @brief Determines the inequality of two derangements. + /// @param left A derangement to compare. + /// @param right A derangement to compare. + /// @return Tre if the derangements are unequal and false otherwise. bool operator!=(const DerangementType& left, const DerangementType& right); + + /// @brief Writes a derangement to an ostream. + /// @param os The ostream to write to. + /// @param derangement The derangement to write. + /// @return The provided ostream for chaining. std::ostream& operator<<(std::ostream& os, const DerangementType& derangement); - DerangementType GetDerangement(int derangementId); + + /// @brief Gets the derangement with a specific id. + /// @param derangement_id The id of the derangement to get. + /// @return The derangement with an id of derangement_id or kDerangementUnknown if derangement_id is invalid. + DerangementType GetDerangement(int derangement_id); + + /// @brief Fills the provided vector with all valid derangements. + /// @param derangements The vector to fill. It will be emptied first. void FillDerangements(std::vector& derangements); } // End namespace SBF /** @}*/ diff --git a/sbf-cpp/Disciplines.h b/sbf-cpp/Disciplines.h index be8adab..c60ad9a 100644 --- a/sbf-cpp/Disciplines.h +++ b/sbf-cpp/Disciplines.h @@ -93,8 +93,15 @@ namespace SBF { kDisciplineThaumaturgyLabel, kDisciplineVicissitudeLabel, }; - std::string GetDisciplineLabel(int disciplineId); - void FillDisciplineLabels(std::vector& disciplineLabels); + + /// @brief Gets the label for a discipline with a specific id. + /// @param discipline_id The id of the discipline to get the label for. + /// @return The label of the discipline or an empty string if discipline_id is invalid. + std::string GetDisciplineLabel(int discipline_id); + + /// @brief Fills the provided vector with all of the valid discipline labels. + /// @param discipline_labels The vector to fill. It will be cleared first. + void FillDisciplineLabels(std::vector& discipline_labels); } // End namespace SBF /** @}*/ #endif // End !defined DISCIPLINES_H__ diff --git a/sbf-cpp/Genders.h b/sbf-cpp/Genders.h index c983f62..96700ed 100644 --- a/sbf-cpp/Genders.h +++ b/sbf-cpp/Genders.h @@ -34,8 +34,15 @@ namespace SBF { kGenderTransFemaleLabel, kGenderNonBinaryLabel, }; - std::string GetGenderLabel(int genderId); - void FillGenderLabels(std::vector& genderLabels); + + /// @brief Gets a gender label with a specific id. + /// @param gender_id The id of the gender to return the label for. + /// @return The label of the specified gender or an empty string if gender_id is invalid. + std::string GetGenderLabel(int gender_id); + + /// @brief Fills the provided vector with all of the valid gender labels. + /// @param gender_labels The vector to fill. It will be cleared first. + void FillGenderLabels(std::vector& gender_labels); } // End namespace SBF /** @}*/ #endif // End !defined GENDERS_H__ diff --git a/sbf-cpp/Ranks.h b/sbf-cpp/Ranks.h index cfd118a..d6c8dcc 100644 --- a/sbf-cpp/Ranks.h +++ b/sbf-cpp/Ranks.h @@ -40,10 +40,31 @@ namespace SBF { kRankTertiary, }; - std::ostream& operator<<(std::ostream& os, const RankType& abilityGroup); + /// @brief Writes a rank to an ostream. + /// @param os The ostream to write to. + /// @param rank The rank to write. + /// @return The provided ostream for chaining. + std::ostream& operator<<(std::ostream& os, const RankType& rank); + + /// @brief Determines if two ranks are equal. + /// @param left A rank to compare. + /// @param right A rank to compare. + /// @return True if both ranks are equal and false otherwise. bool operator==(const RankType& left, const RankType& right); + + /// @brief Determines if two ranks are unequal. + /// @param left A rank to compare. + /// @param right A rank to compare. + /// @return True if both ranks are unequal and false otherwise. bool operator!=(const RankType& left, const RankType& right); - RankType GetRank(int rankId); + + /// @brief Gets a rank with a specific id. + /// @param rank_id The id of the rank to get. + /// @return The rank with id == rank_id or the unknown rank kRankUnknown if rank_id is invalid. + RankType GetRank(int rank_id); + + /// @brief Fills the provided vector with all valid rank labels. + /// @param ranks The vector to fill. It will be cleared first. void FillRanks(std::vector& ranks); } // End namespace SBF /** @}*/ diff --git a/sbf-cpp/Virtues.h b/sbf-cpp/Virtues.h index dabbd3b..4089acf 100644 --- a/sbf-cpp/Virtues.h +++ b/sbf-cpp/Virtues.h @@ -33,11 +33,11 @@ namespace SBF { /// @brief Gets the label for virtue with the specified id. /// @param virtue_id The id of the virtue to find. - /// @return The label for the specified virtue. + /// @return The label for the specified virtue or an empty string if virtue_id is invalid. const std::string GetVirtueLabel(int virtue_id); /// @brief Fills the vector with all of the valid virtue labels. - /// @param virtue_labels The vector to fill. + /// @param virtue_labels The vector to fill. It will be cleared first. void FillVirtueLabels(std::vector& virtue_labels); } // End namespace SBF /** @}*/