From 58d981d5f2a63e8a949ebab47744d2ba33ff145f Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Fri, 9 Sep 2022 23:24:41 +0800 Subject: [PATCH] Added isInitializeOfMatch function in MemberRulesData --- .../hook/core/finder/members/data/MemberRulesData.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MemberRulesData.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MemberRulesData.kt index 076b4021..b9601dec 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MemberRulesData.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/data/MemberRulesData.kt @@ -45,13 +45,19 @@ internal open class MemberRulesData internal constructor( override val objectName get() = "Member" + /** + * 判断 [matchCount]、[matchCountRange] 规则是否已经初始化 (设置了任意一个参数) + * @return [Boolean] + */ + internal val isInitializeOfMatch get() = matchCount >= 0 || matchCountRange != IntRange.EMPTY + /** * 判断 [BaseRulesData] 规则是否已经初始化 (设置了任意一个参数) * @return [Boolean] */ internal val isInitializeOfSuper get() = super.isInitialize - override val isInitialize get() = isInitializeOfSuper || matchCount >= 0 || matchCountRange != IntRange.EMPTY + override val isInitialize get() = isInitializeOfSuper || isInitializeOfMatch override fun hashCode(other: Any?) = super.hashCode(other) + "[$isFindInSuper][$matchIndex][$matchCountRange]".hashCode() } \ No newline at end of file