public FuHeSanDian(string name, SanDian sd, int zhidingx = -1, int zhidingy = -1, string dianhanyi = null, List <ZuoBiao> listzuobiao = null) { this._name = name; this._sd = sd; this._zhidingx = zhidingx; this._zhidingy = zhidingy; this._dianhanyi = dianhanyi; this._listzuobiao = listzuobiao; }
public bool Equals(SanDian other) { //this非空,obj如果为空,则返回false if (ReferenceEquals(null, other)) return false; //如果为同一对象,必然相等 if (ReferenceEquals(this, other)) return true; //对比各个字段值 if (!(this.mx1==other.Mx1) || !(this.my1==other.My1) || !(this.myanse1==other.Myanse1) || !(this.mx2==other.Mx2) || !(this.my2==other.My2) || !(this.myanse2==other.Myanse2) || !(this.mx3==other.Mx3) || !(this.my3==other.My3) || !(this.myanse3==other.Myanse3)) return false; //如果基类不是从Object继承,需要调用base.Equals(other) //如果从Object继承,直接返回true return true; }