diff --git a/src/Luban.Job.Cfg/Source/Datas/DEnum.cs b/src/Luban.Job.Cfg/Source/Datas/DEnum.cs index 1630175..e69200d 100644 --- a/src/Luban.Job.Cfg/Source/Datas/DEnum.cs +++ b/src/Luban.Job.Cfg/Source/Datas/DEnum.cs @@ -41,7 +41,13 @@ namespace Luban.Job.Cfg.Datas public override bool Equals(object obj) { - return obj is DEnum o && o.Value == this.Value; + switch (obj) + { + case DInt dint: return this.Value == dint.Value; + case DFint fint: return this.Value == fint.Value; + case DEnum denum: return this.Value == denum.Value; + default: return false; + } } public override int GetHashCode() diff --git a/src/Luban.Job.Cfg/Source/Datas/DFint.cs b/src/Luban.Job.Cfg/Source/Datas/DFint.cs index 0a9fe3c..1d40629 100644 --- a/src/Luban.Job.Cfg/Source/Datas/DFint.cs +++ b/src/Luban.Job.Cfg/Source/Datas/DFint.cs @@ -30,7 +30,13 @@ namespace Luban.Job.Cfg.Datas public override bool Equals(object obj) { - return obj is DInt o && o.Value == this.Value; + switch (obj) + { + case DInt dint: return this.Value == dint.Value; + case DFint fint: return this.Value == fint.Value; + case DEnum denum: return this.Value == denum.Value; + default: return false; + } } public override int GetHashCode() diff --git a/src/Luban.Job.Cfg/Source/Datas/DInt.cs b/src/Luban.Job.Cfg/Source/Datas/DInt.cs index 606caed..d99bfce 100644 --- a/src/Luban.Job.Cfg/Source/Datas/DInt.cs +++ b/src/Luban.Job.Cfg/Source/Datas/DInt.cs @@ -30,7 +30,13 @@ namespace Luban.Job.Cfg.Datas public override bool Equals(object obj) { - return obj is DInt o && o.Value == this.Value; + switch (obj) + { + case DInt dint: return this.Value == dint.Value; + case DFint fint: return this.Value == fint.Value; + case DEnum denum: return this.Value == denum.Value; + default: return false; + } } public override int GetHashCode()