So I have a lot of stuff I need to load for my project that is a static set of data that is assigned an id, name, and image, I think basically the kind of thing you'd assign const to.
For instance “Aptitudes” which are the skills of a character in a magical discipline. So it has an ID, but most importantly a name like Summoning, and an image for the icon that goes in the UI.
Then the character has an “AptitudeValue” that is the type plus their malleable personal capability stored in an int.
Similarly I have some interaction details that are CommitmentType, which is connected to a Commitment. So something might be a promise or a vow or an oath. These have distinct meanings in the game logic. So a CommitmentType might be an “Oath Of Allegiance”.
Both of these inherit from Identity which holds the ID, name("Oath Of Allegiance"), and image. The CommitmentType class holds a string, that will be one of the types(oath, vow, promise, etc).
I have a primary object, the WorldManager that holds mostly pointers to stuff. For the purposes of this thread it has Managers, this may not be the proper jargon usage, for different Types. For instance CommitmentTypesManager. That looks like this:
//=============================================
// CommitmentTypesManager
//=============================================
class CommitmentTypesManager {
private:
std::vector<CommitmentType*> commitmentTypes;
public:
int getCommitmentTypeCount() {return commitmentTypes.size();}
CommitmentType *getCommitmentType(int i) {return commitmentTypes[i];}
CommitmentType *getCommitmentTypeById(int id);
CommitmentType *getCommitmentTypeByName(std::string name);
CommitmentType *addCommitmentType(int id, std::string name);
};
The actual commitment instances will have variable data that will be set during gameplay:
//=============================================
// Commitment
//=============================================
class Commitment {
private:
CommitmentType *type;
int duration;
int deadline;
Character *maker;
Character *recipient;
public:
std::string description();
CommitmentType *getType() {return type;}
void setType(CommitmentType *newType) {type = newType;}
};
Is there a more useful way to store the non-variable data for AptitudeTypes or CommitmentTypes and similar classes? Will it matter for performance at all? Is there a more generally known specific term for these types of constructs rather than Manager? I know it has a jargon meaning but I can't recall if it is appropriate in this context.