feat: FlexibleProcessing as alternative to EntityComponentProcessor for lightweight, abstract and typesafe processing in idiomatic c# #2331
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Details
This PR enables building of processors from interfaces, enabling unrelated types to be processed by the same system.
The current processor implementation force users to derive from the same root type to build their logic, this does not work well with the fact that we have different 'Script' variant which have all their specific use. It becomes a composition issue when more abstract concepts, like event functions, are introduced.
A good example of that is when components should manipulate physics object, it is preferable to do so in lockstep with the physics engine's tick. But those component may also require an async or update loop to process inputs. We would be forced to either create another new 'script' type which users have to derive from which would split their logic between two different types, or tie it to one of the other 'script', both solutions would introduce additional overhead while not being practical.
Example usage:
Implementer may include additional processing during the
OnComponentAdded
step to reduce or elide virtual callsRelated Issue
Introduced for usage in #2131
Types of changes
Checklist