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

Make config keys configurable with components #14

Merged
merged 11 commits into from
May 7, 2024

Conversation

ColinTimBarndt
Copy link
Contributor

@ColinTimBarndt ColinTimBarndt commented May 5, 2024

This is an implementation of config key components as mentioned in #9. Feedback is appreciated.

Resolves #9.

To Do:

  • Component cache with tombstones. This would allow for efficient marker components that serve as boolean flags.
  • Extract component implementation into another class for reusability outside of config keys.

@ColinTimBarndt ColinTimBarndt added the enhancement New feature or request label May 5, 2024
@Banane9 Banane9 marked this pull request as ready for review May 6, 2024 22:14
@Banane9 Banane9 requested a review from l-2-j May 6, 2024 22:14
Copy link
Member

@l-2-j l-2-j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very C# like with how everything has interfaces and abstractions, which IG is what Banane wants... At least IMO should stick to consistent interface/class definition file split (&order) tho, can't say I see much wrong with the implementation.... because I don't feel like I have enough free time to dedicate to trying to figure out how this'll be used from a modder's perspective...

@l-2-j l-2-j requested a review from Banane9 May 7, 2024 16:53
l-2-j
l-2-j previously approved these changes May 7, 2024
Copy link
Member

@l-2-j l-2-j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also to keep old traditions alive;
obviously evil seal

@Banane9
Copy link
Member

Banane9 commented May 7, 2024

because I don't feel like I have enough free time to dedicate to trying to figure out how this'll be used from a modder's perspective...

From the defining a config perspective:

DefiningConfigKey<int> testKey = new("Test", ...)
{
    new ConfigKeyRange(0, 255)
}

The constructor still has the standard things too, but now more behavior can be added super easily. E.g. Quantities or Shared for Resonite.

…nts to make ML.Components using unnecessary.
@Banane9 Banane9 merged commit ab28e02 into master May 7, 2024
@Banane9 Banane9 deleted the feature/config-key-components branch May 7, 2024 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a trait/component system for (defining) config keys
3 participants