public override bool Equals(Entite entite) { if (!base.Equals(entite)) { return(false); } Marchand m = entite as Marchand; if (m == null) { return(false); } if (echanges.Length != m.echanges.Length) { return(false); } for (int i = 0; i < echanges.Length; i++) { if ((echanges[i] == null) != (m.echanges[i] == null)) { return(false); } if (echanges[i] == null) { continue; } if (!echanges[i].Equals(m.echanges[i])) { return(false); } } return(true); }
public override Entite Clone() { Marchand m = new Marchand(x, y, echanges); m.inventaire = m.inventaire.Clone(); m.vie = vie; return(m); }