【cfg】ref 检查支持int、fint、enum类型之间等值判定
parent
a36b118a98
commit
2f46d40ca3
|
|
@ -41,7 +41,13 @@ namespace Luban.Job.Cfg.Datas
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
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()
|
public override int GetHashCode()
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,13 @@ namespace Luban.Job.Cfg.Datas
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
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()
|
public override int GetHashCode()
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,13 @@ namespace Luban.Job.Cfg.Datas
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
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()
|
public override int GetHashCode()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue