From 2f46d40ca3c034ef46d46ba4459cf5692ffa68dd Mon Sep 17 00:00:00 2001 From: walon Date: Fri, 4 Jun 2021 12:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90cfg=E3=80=91ref=20=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81int=E3=80=81fint=E3=80=81enum=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=B9=8B=E9=97=B4=E7=AD=89=E5=80=BC=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Luban.Job.Cfg/Source/Datas/DEnum.cs | 8 +++++++- src/Luban.Job.Cfg/Source/Datas/DFint.cs | 8 +++++++- src/Luban.Job.Cfg/Source/Datas/DInt.cs | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) 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()