Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Alejandro Martínez Muñoz
/
ProyectoRobotAmbientales
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b8ff3158
authored
Apr 29, 2024
by
Alex
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
cambio de nombres
parent
bfd54a46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
src/app/mapa/mapa.component.ts
src/app/mapa/mapa.component.ts
View file @
b8ff3158
...
...
@@ -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
sinConexion
Izquierd
a
:
string
[]
=
[
'02'
,
'05'
,
'06'
,
'10'
,
'00'
];
sinConexion
Derech
a
:
string
[]
=
[
'02'
,
'03'
,
'04'
,
'08'
,
'00'
];
sinConexionA
rriba
:
string
[]
=
[
'01'
,
'03'
,
'06'
,
'07'
,
'00'
];
sinConexionA
bajo
:
string
[]
=
[
'04'
,
'05'
,
'09'
,
'00'
];
sinConexion
Derech
a
:
string
[]
=
[
'02'
,
'05'
,
'06'
,
'10'
,
'00'
];
sinConexion
Izquierd
a
:
string
[]
=
[
'02'
,
'03'
,
'04'
,
'08'
,
'00'
];
sinConexionA
bajo
:
string
[]
=
[
'01'
,
'03'
,
'06'
,
'07'
,
'00'
];
sinConexionA
rriba
:
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
.
sinConexion
Izquierda
.
includes
(
this
.
mapMatrix
[
row
][
col
-
1
]))
conexionesValidas
++
;
if
(
col
<
this
.
cols
-
1
&&
!
this
.
sinConexion
Derecha
.
includes
(
this
.
mapMatrix
[
row
][
col
+
1
]))
conexionesValidas
++
;
if
(
col
>
0
&&
!
this
.
sinConexion
Derecha
.
includes
(
this
.
mapMatrix
[
row
][
col
-
1
]))
conexionesValidas
++
;
//A su izquierda
if
(
col
<
this
.
cols
-
1
&&
!
this
.
sinConexion
Izquierda
.
includes
(
this
.
mapMatrix
[
row
][
col
+
1
]))
conexionesValidas
++
;
//A su derecha
}
else
if
(
celdaId
===
'02'
)
{
if
(
row
>
0
&&
!
this
.
sinConexionA
rriba
.
includes
(
this
.
mapMatrix
[
row
-
1
][
col
]))
conexionesValidas
++
;
if
(
row
<
this
.
rows
-
1
&&
!
this
.
sinConexionA
bajo
.
includes
(
this
.
mapMatrix
[
row
+
1
][
col
]))
conexionesValidas
++
;
if
(
row
>
0
&&
!
this
.
sinConexionA
bajo
.
includes
(
this
.
mapMatrix
[
row
-
1
][
col
]))
conexionesValidas
++
;
//Arriba
if
(
row
<
this
.
rows
-
1
&&
!
this
.
sinConexionA
rriba
.
includes
(
this
.
mapMatrix
[
row
+
1
][
col
]))
conexionesValidas
++
;
//Abajo
}
return
conexionesValidas
===
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment