[DamageTypeAPI] Rewrite to use patcher field, instead of il hooks and ConditionalWeakTable #566
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.
This feels like a good time to do this, since with DamageTypeSource addition people would be likely to update their mods and check that new changes to the api work fine.
I liked the way ProcTypeAPI was done and I think it would be great to do same thing to DamageTypeAPI since with SOTS we also have a struct for all damage type needs. This allows us to remove all the IL hooks leaving only a few necessary On hooks which is always great.
This update should not be a breaking change, despite removing a ModdedTypeDamageHolder class. I checked all non-deprecated mods and none of them reference this class or methods that return this class or have it as a parameter. ModdedTypeDamageHolderComponent is no longer necessary but it is used by mods so it was marked as obsolete and redirected to use new field.