Exemple #1
0
        private void DeterminarApagado(ISector[,] pMatrizLugar, int pfilas, int pColumnas, int pCantidadAgua)
        {
            string  strResultado = "(" + pfilas + " , " + pColumnas + ") --> ";
            ISector sector       = pMatrizLugar[pfilas, pColumnas];
            bool    boolApagado  = sector.EstaApagado();

            if (boolApagado == true)
            {
                boolApagado   = true;
                strResultado += sector.getPorcentajeAfectacionFuego() + " --> 0";
                Console.WriteLine(strResultado);
            }
            else
            {
                strResultado += sector.getPorcentajeAfectacionFuego();
                sector.Mojar(pCantidadAgua);
                boolApagado = sector.EstaApagado();
                if (boolApagado == true)
                {
                    strResultado += " --> 0";
                }
                while (boolApagado == false)
                {
                    strResultado += " --> " + sector.getPorcentajeAfectacionFuego();
                    sector.Mojar(pCantidadAgua);
                    if (sector.EstaApagado() == true)
                    {
                        strResultado += " --> 0";
                        boolApagado   = true;
                    }
                }
                Console.WriteLine(strResultado);
            }
        }
Exemple #2
0
 public virtual void Mojar(double pAgua)
 {
     sector.Mojar(pAgua);
 }