mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-29 13:00:17 +02:00
fix: story boost state mapper
This commit is contained in:
parent
54d65cc017
commit
b7422d9795
@ -9,8 +9,11 @@ class StoryBoostStateMapper : Mapper(){
|
|||||||
mappings: MutableMap<String, Any>
|
mappings: MutableMap<String, Any>
|
||||||
) {
|
) {
|
||||||
for (clazz in classes) {
|
for (clazz in classes) {
|
||||||
val firstField = clazz.declaredFields.firstOrNull() ?: continue
|
val firstConstructor = clazz.constructors.firstOrNull() ?: continue
|
||||||
if (!firstField.type.isEnum || firstField.type.enumConstants.none { it.toString() == "NeedSubscriptionCannotSubscribe" }) continue
|
if (firstConstructor.parameterCount != 3) continue
|
||||||
|
if (firstConstructor.parameterTypes[1] != Long::class.javaPrimitiveType || firstConstructor.parameterTypes[2] != Long::class.javaPrimitiveType) continue
|
||||||
|
val storyBoostEnumClass = firstConstructor.parameterTypes[0]
|
||||||
|
if (!storyBoostEnumClass.isEnum || storyBoostEnumClass.enumConstants.none { it.toString() == "NeedSubscriptionCannotSubscribe" }) continue
|
||||||
mappings["StoryBoostStateClass"] = clazz.name
|
mappings["StoryBoostStateClass"] = clazz.name
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user