Okay, so I'm writing a custom D&D character creator and manager (like, has a built in dice roller, with a manual input and the ability to click a skill and it rolls for you with all the modifiers and stuff), for funsies and to get more experience making complex data structures, and im in a bit of a design wall at the moment.
So, at the moment I am trying to think of how to make a system that allows your character to have multiple 'traits', basically things in the character creator that have a name, description, and something that modifies your character ( for example, granting proficiency in a skill, this "something" sometimes would be null, for things that cant be represented in the character sheet ( like rp abilities, conditional advantage on rolls and other such ) )
Im not good at wording design issues, so I will make a list of requirements.
1 - CC_Character has a single list of several 'trait' components
2 - every type of trait would need to be able to go into the same list, whether by inhereting from an abstract class or other programming wizardry
3 - the trait component must be able to modify CC_Character in a way that allows its modifications to be tracked, so changes can be reverted if you remove the trait from the character.
4 - handling for the fact some granted traits would require varying parameters
5 - must be JSON friendly