示例#1
0
        public Producto Cocina(Ingrediente ingrediente1, Ingrediente ingrediente2, Ingrediente ingrediente3, int calidadInstalaciones)
        {
            int calidadDelProducto = (ingrediente1.getCalidad() * m_level) + (ingrediente2.getCalidad() * m_level) + (ingrediente3.getCalidad() * m_level);
            int cantidadDeProducto = m_level * calidadInstalaciones;
            m_estado = Estado.Cocinando;
            tiempoOcupado = 20000;
            m_experience += calidadDelProducto * cantidadDeProducto;

            return new Producto(cantidadDeProducto,calidadDelProducto);
        }
示例#2
0
 public bool CompraIngrediente(Ingrediente ing, int precioDelIngrediente)
 {
     if (precioDelIngrediente > m_money)
     {
         return false;
     }
     else
     {
         m_money -= precioDelIngrediente;
         AlmacenaIngrediente(ing);
         return true;
     }
 }
示例#3
0
 private void AlmacenaIngrediente(Ingrediente ing)
 {
     bool found = false;
     foreach (Ingrediente ingrediente in Ingredientes)
     {
         if (ingrediente.getNombre().Equals(ing.getNombre()))
         {
             ingrediente.AgregaIngrediente(ing);
             found = true;
             break;
         }
     }
     if (!found)
     {
         Ingredientes.Add(ing);
     }
 }