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

Add code generation for validation logic #23

Open
KallDrexx opened this issue Oct 3, 2020 · 0 comments
Open

Add code generation for validation logic #23

KallDrexx opened this issue Oct 3, 2020 · 0 comments
Labels
Code Generation Impacts how a component's code generation occurs Emitter Component changes to triggers, initializers, modifiers, etc... enhancement New feature or request

Comments

@KallDrexx
Copy link
Owner

There are some cases where the code generated by an emitter definition may cause an exception to be thrown in some scenarios. One example of this is the RandomParticleCountInitiailzer, as it will call Random.Next(), but if the max is less than the min value an exception will be raised.

While a fix is being put in to make this less likely to happen with generated code, it will still be possible for game developers to modify the properties manually in the generated class.

It would be useful for components to be able to specify logic that gets executed in a EmitterLogic.Validate() call, so a component can look for error conditions and throw a more helpful exception. This is also helpful to keep the number of times the validation logic has to be run to a minimu.

@KallDrexx KallDrexx added enhancement New feature or request Emitter Component changes to triggers, initializers, modifiers, etc... Code Generation Impacts how a component's code generation occurs labels Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Generation Impacts how a component's code generation occurs Emitter Component changes to triggers, initializers, modifiers, etc... enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant