diff --git a/Megumin.Explosion/Megumin.Explosion.csproj b/Megumin.Explosion/Megumin.Explosion.csproj
index 028b5f4..4ae75aa 100644
--- a/Megumin.Explosion/Megumin.Explosion.csproj
+++ b/Megumin.Explosion/Megumin.Explosion.csproj
@@ -5,9 +5,9 @@
云却
- 1.0.1.0
- 1.0.1.0
- 1.0.1.0
+ 1.0.2.0
+ 1.0.2.0
+ 1.0.2.0
MeguminLibrary
diff --git a/Megumin.Explosion/Megumin/Class/Multiple.cs b/Megumin.Explosion/Megumin/Class/Multiple.cs
index 7722c4c..b3e72b6 100644
--- a/Megumin.Explosion/Megumin/Class/Multiple.cs
+++ b/Megumin.Explosion/Megumin/Class/Multiple.cs
@@ -32,7 +32,7 @@ protected virtual void ApplyValue()
Current = newValue;
CurrentKey = newKey;
- bool flagV = EqualityComparer.Default.Equals(oldValue, newValue);
+ bool flagV = EqualsValue(oldValue, newValue);
//if (old is IEquatable oe)
//{
// //转成接口必然装箱
@@ -50,12 +50,60 @@ protected virtual void ApplyValue()
OnValueChangedKV((newKey, newValue), (oldKey, oldValue));
}
- if (!flagV || !EqualityComparer.Default.Equals(oldKey, newKey))
+ if (!flagV || !EqualsKey(oldKey, newKey))
{
OnKeyValueChanged((newKey, newValue), (oldKey, oldValue));
}
}
+ ///
+ /// 判定Key是否相等
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// 必须使用EqualsKey,EqualsValue两个函数名,不能同名使用重载,否则在子类重写时会提示二义性,无法重写,编译错误。
+ ///
+ protected virtual bool EqualsKey(K x, K y)
+ {
+ bool flag = EqualityComparer.Default.Equals(x, y);
+ return flag;
+ }
+
+ protected virtual bool EqualsValue(V x, V y)
+ {
+ bool flag = EqualityComparer.Default.Equals(x, y);
+ return flag;
+ }
+
+ //public bool Equals(object objA, object objB)
+ //{
+ // return object.Equals(objA, objB);
+ //}
+
+ protected virtual bool EqualsKey(object x, object y)
+ {
+ return Equals(x, y);
+ }
+
+ protected bool EqualsValue(bool x, bool y)
+ {
+ return x == y;
+ }
+
+ protected bool EqualsValue(int x, int y)
+ {
+ return x == y;
+ }
+
+ protected virtual bool EqualsValue(N x, N y)
+ where N : IEquatable
+ {
+ bool flag = x.Equals(y);
+ return flag;
+ }
+
///
/// 计算新的值, 返回值也可以用KeyValuePair,没什么区别.
///
diff --git a/Megumin.Explosion/Megumin/Class/MultipleControl.cs b/Megumin.Explosion/Megumin/Class/MultipleControl.cs
index 50efbdb..5e615ca 100644
--- a/Megumin.Explosion/Megumin/Class/MultipleControl.cs
+++ b/Megumin.Explosion/Megumin/Class/MultipleControl.cs
@@ -208,6 +208,7 @@ protected override (K Key, V Value) CalNewValue()
/// 可以将ascending参数设置为true,改为 只要有个一个源为false,结果就是false.
///
/// 处理黑屏,碰撞盒开闭
+ [Obsolete("use AnyTrueControl instead")]
public class ActiveControl : MultipleControl