You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traits should be able to modify components without overwriting them.
The easiest approach without using reflection would be to create an abstract TraitBehavivor class with abstract methods Apply and CanApply, and re-implement most existing trait-related systems as effects. The old (default) behaviors would have to be moved to something like AddComponentBehavior (which should fail if the component is already present, unless a special override flag is set), RemoveComponentBehavior, AddLanguageBehavior, ... - you get the idea.
While implementing that, it's important not to repeat the mistake with character requirements - do not, under any circumstances, make those methods accept 20 parameters all at once. Make a separate class for that if you think it's necessary. See how reagent effects do it for more info.
Removal of trait requirement bloat
It should be obvious, but adding a CharacterTraitRequirement and listing all other traits within a mutually-exclusive trait group is a REALLY bad approach towards implementing a "pick one" kind of traits.
Some kind of character trait groups should be implemented instead. That would reduce the amount of bloat while also improving readability and maintainability of the existing traits.
The text was updated successfully, but these errors were encountered:
Non-destructive component modification
Traits should be able to modify components without overwriting them.
The easiest approach without using reflection would be to create an abstract TraitBehavivor class with abstract methods Apply and CanApply, and re-implement most existing trait-related systems as effects. The old (default) behaviors would have to be moved to something like AddComponentBehavior (which should fail if the component is already present, unless a special override flag is set), RemoveComponentBehavior, AddLanguageBehavior, ... - you get the idea.
While implementing that, it's important not to repeat the mistake with character requirements - do not, under any circumstances, make those methods accept 20 parameters all at once. Make a separate class for that if you think it's necessary. See how reagent effects do it for more info.
Removal of trait requirement bloat
It should be obvious, but adding a CharacterTraitRequirement and listing all other traits within a mutually-exclusive trait group is a REALLY bad approach towards implementing a "pick one" kind of traits.
Some kind of character trait groups should be implemented instead. That would reduce the amount of bloat while also improving readability and maintainability of the existing traits.
The text was updated successfully, but these errors were encountered: