Commit b8ff3158 by Alex

cambio de nombres

parent bfd54a46
Showing with 8 additions and 8 deletions
......@@ -27,10 +27,10 @@ export class MapaComponent implements OnInit {
SeleccionadoIdEntrega: string | null = null;
// Listas de IDs que no constituyen una conexión válida según la dirección
sinConexionIzquierda: string[] = ['02', '05', '06', '10', '00'];
sinConexionDerecha: string[] = ['02', '03', '04', '08', '00'];
sinConexionArriba: string[] = ['01', '03', '06', '07', '00'];
sinConexionAbajo: string[] = ['04', '05', '09', '00'];
sinConexionDerecha: string[] = ['02', '05', '06', '10', '00'];
sinConexionIzquierda: string[] = ['02', '03', '04', '08', '00'];
sinConexionAbajo: string[] = ['01', '03', '06', '07', '00'];
sinConexionArriba: string[] = ['01','04', '05', '09', '00'];
constructor(private MapaService: MapaService) { }
......@@ -49,11 +49,11 @@ export class MapaComponent implements OnInit {
let conexionesValidas = 0;
if (celdaId === '01') {
if (col > 0 && !this.sinConexionIzquierda.includes(this.mapMatrix[row][col - 1])) conexionesValidas++;
if (col < this.cols - 1 && !this.sinConexionDerecha.includes(this.mapMatrix[row][col + 1])) conexionesValidas++;
if (col > 0 && !this.sinConexionDerecha.includes(this.mapMatrix[row][col - 1])) conexionesValidas++; //A su izquierda
if (col < this.cols - 1 && !this.sinConexionIzquierda.includes(this.mapMatrix[row][col + 1])) conexionesValidas++; //A su derecha
} else if (celdaId === '02') {
if (row > 0 && !this.sinConexionArriba.includes(this.mapMatrix[row - 1][col])) conexionesValidas++;
if (row < this.rows - 1 && !this.sinConexionAbajo.includes(this.mapMatrix[row + 1][col])) conexionesValidas++;
if (row > 0 && !this.sinConexionAbajo.includes(this.mapMatrix[row - 1][col])) conexionesValidas++; //Arriba
if (row < this.rows - 1 && !this.sinConexionArriba.includes(this.mapMatrix[row + 1][col])) conexionesValidas++; //Abajo
}
return conexionesValidas === 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment