As a developer I want to have generic information of component being added or removed, so that I can add extra validation steps if I do so require.
While this feature won't be used in most games, it can be quite crucial for third-party Flame packages developers as it gives them the extra control to enforce certain rules that their package might require, for instance a custom ECS build on top of the existing FCS.
My proposal is to add generic parameters to the following methods:
Component.add
Future<void>? add<T extends Component>(T component) {
// add logic stays the same.
}
Component.remove
void remove<T extends Component>(T component) {
// remove logic stays the same.
}
Component.addToParent
Future<void>? addToParent<T extends Component>(T parent) {
// addToParent logic stays the same.
}
Component.changeParent
void changeParent<T extends Component>(T parent) {
// changeParent logic stays the same.
}
This would be a breaking change as the method definition will change, and anyone who was already overwriting these methods will have to make changes to reflect the new definition.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too