Skip to content

Add code generation for validation logic #23

@KallDrexx

Description

@KallDrexx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code GenerationImpacts how a component's code generation occursEmitter Componentchanges to triggers, initializers, modifiers, etc...enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions