コード例 #1
0
 public Estacionamiento(decimal elPrecio, int cantidadDeCocheras)
 {
     //PrecioDeUso = elPrecio;
     cocheras = new Cochera[cantidadDeCocheras];
     for (int i = 0; i < cantidadDeCocheras; i++)
     {
         Cochera nuevaCochera = new Cochera();
         cocheras[i] = nuevaCochera;
     }
 }
コード例 #2
0
        public Cochera BuscarCocheraDisponible()
        {
            Cochera res = null;

            for (int i = 0; i < cocheras.Length; i++)
            {
                if (cocheras[i].estaDisponible() == true)
                {
                    res = cocheras[i];
                    break;
                }
            }
            return(res);
        }