public bool EntraVaca(Vaca vaca) { if (PesActual + vaca.Pes <= MaxPes) { PesActual += vaca.Pes; Litres += vaca.Litres; Vaques.Add(vaca); return(true); } return(false); }
public override bool Equals(Object obj) { //Check for null and compare run-time types. if ((obj == null) || !this.GetType().Equals(obj.GetType())) { return(false); } else { Vaca other = (Vaca)obj; return(Nom == other.Nom); } }
public void SurtVaca(Vaca vaca) { PesActual -= vaca.Pes; Litres -= vaca.Litres; Vaques.Remove(vaca); }