Exemple #1
0
 public bool esOcupable(Bloque proveniente)
 {
     if (proveniente.GetType() == this.GetType())
         return true;
     if (this is Aire) return true;
     return false;
 }
Exemple #2
0
 private static Bloque[,] armarBloques(string nivel,out string pared)
 {
     Bloque[,] b = new Bloque[Laberinto.ancho, Laberinto.alto];
     string cadena = nivel;
     int posicion = 0;
     for (int y = Laberinto.alto-Laberinto.TBloque; y >= 0; y -= Laberinto.TBloque)
     {
         for (int x = 0; x < Laberinto.ancho; x += Laberinto.TBloque)
         {
             while (cadena[posicion] == '\n' || cadena[posicion] == '\r')
                 posicion++;
             b[x, y] = getBloqueSegunchar(cadena[posicion], new System.Drawing.Point(x, y));
             if (b[x, y] is Aire)
             {
                 for (int nnx = 0; nnx < Laberinto.TBloque; nnx++)
                 {
                     for (int nny = 0; nny < Laberinto.TBloque; nny++)
                     {
                         if (nnx == 0 && nny == 0) { }
                         else
                         {
                             b[x + nnx, y + nny] = b[x, y];
                         }
                     }
                 }
                 //b[x, y + 1] = b[x, y];
                 //b[x + 1, y] = b[x, y];
                 //b[x + 1, y + 1] = b[x, y];
             }
             posicion++;
         }
     }
     string resto = cadena.Substring(posicion+2);
     pared = resto;
     return b;
 }