Adds documentation to the implemented modules.

This commit is contained in:
2023-04-18 00:11:29 -07:00
parent 9b344b5d6b
commit 891890f779
10 changed files with 191 additions and 74 deletions

View File

@@ -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<string>& abilities, int abilityGroupId) {
void FillAbilitiesForAbilityGroup(vector<string>& 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<string>& labels, int abilityGroupId) {
void FillAbilityLabels(vector<string>& labels, int id) {
labels.clear();
switch (abilityGroupId) {
switch (id) {
case kAbilityTalentsId:
FillTalentLabels(labels);
break;

View File

@@ -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<std::string>& abilities, int abilityGroupId);
/// @param id The id of the ability group to fill for.
void FillAbilitiesForAbilityGroup(std::vector<std::string>& 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<std::string>& labels, int abilityGroupId);
/// @param id The id of the ability group to fill for.
void FillAbilityLabels(std::vector<std::string>& 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<std::string>& knowledgeLabels);
/// @param labels The vector to fill.
void FillKnowledgeLabels(std::vector<std::string>& 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<std::string>& skillLabels);
/// @param labels The vector to fill.
void FillSkillLabels(std::vector<std::string>& 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<std::string>& talentLabels);
/// @param labels The vector to fill.
void FillTalentLabels(std::vector<std::string>& 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__

View File

@@ -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<std::string>& attributeGroupLabels);
void FillAttributeLabelsInGroup(std::vector<std::string>& attributeLabels, int groupId);
void FillPhysicalAttributeLabels(std::vector<std::string>& physicalAttributeLabels);
void FillSocialAttributeLabels(std::vector<std::string>& socialAttributeLabels);
void FillMentalAttributeLabels(std::vector<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& labels);
} // End namespace SBF
/** @}*/
#endif // End !defined ATTRIBUTES_H__

View File

@@ -50,8 +50,15 @@ namespace SBF {
kBackgroundRetainersLabel,
kBackgroundStatusLabel,
};
std::string GetBackgroundLabel(int backgroundId);
void FillBackgroundLabels(std::vector<std::string>& 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<std::string>& background_labels);
} // End namespace SBF
/** @}*/
#endif // End !defined BACKGROUNDS_H__

View File

@@ -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<std::string>& clans);
} // End namespace SBF
/** @}*/

View File

@@ -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<DerangementType>& derangements);
} // End namespace SBF
/** @}*/

View File

@@ -93,8 +93,15 @@ namespace SBF {
kDisciplineThaumaturgyLabel,
kDisciplineVicissitudeLabel,
};
std::string GetDisciplineLabel(int disciplineId);
void FillDisciplineLabels(std::vector<std::string>& 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<std::string>& discipline_labels);
} // End namespace SBF
/** @}*/
#endif // End !defined DISCIPLINES_H__

View File

@@ -34,8 +34,15 @@ namespace SBF {
kGenderTransFemaleLabel,
kGenderNonBinaryLabel,
};
std::string GetGenderLabel(int genderId);
void FillGenderLabels(std::vector<std::string>& 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<std::string>& gender_labels);
} // End namespace SBF
/** @}*/
#endif // End !defined GENDERS_H__

View File

@@ -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<RankType>& ranks);
} // End namespace SBF
/** @}*/

View File

@@ -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<std::string>& virtue_labels);
} // End namespace SBF
/** @}*/