Exemple #1
0
 public bool EntraVaca(Vaca vaca)
 {
     if (PesActual + vaca.Pes <= MaxPes)
     {
         PesActual += vaca.Pes;
         Litres    += vaca.Litres;
         Vaques.Add(vaca);
         return(true);
     }
     return(false);
 }
Exemple #2
0
 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);
     }
 }
Exemple #3
0
 public void SurtVaca(Vaca vaca)
 {
     PesActual -= vaca.Pes;
     Litres    -= vaca.Litres;
     Vaques.Remove(vaca);
 }