Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traits badly need a rework #1134

Open
Mnemotechnician opened this issue Oct 23, 2024 · 0 comments
Open

Traits badly need a rework #1134

Mnemotechnician opened this issue Oct 23, 2024 · 0 comments
Labels
Type: Feature Creation of or significant changes to a feature

Comments

@Mnemotechnician
Copy link
Contributor

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.

@Mnemotechnician Mnemotechnician added the Type: Feature Creation of or significant changes to a feature label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Creation of or significant changes to a feature
Projects
None yet
Development

No branches or pull requests

1 participant