Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
e49f8928
Commit
e49f8928
authored
Dec 13, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix on move up/down task
parent
33ae663c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
33 deletions
+2
-33
role.ts
src/app/class/role/role.ts
+2
-33
No files found.
src/app/class/role/role.ts
View file @
e49f8928
...
@@ -63,7 +63,7 @@ export class Role {
...
@@ -63,7 +63,7 @@ export class Role {
this
.
tasks
[
i
][
j
+
1
]
=
tmp
;
this
.
tasks
[
i
][
j
+
1
]
=
tmp
;
}
else
if
(
direction
==
'top'
)
{
}
else
if
(
direction
==
'top'
)
{
if
(
!
(
this
.
tasks
[
i
-
1
].
some
(
element
=>
element
instanceof
Task
)))
{
if
(
!
(
this
.
tasks
[
i
-
1
].
some
(
element
=>
element
instanceof
Task
)))
{
this
.
tasks
[
i
-
1
][
j
]
=
tmp
;
this
.
tasks
[
i
-
1
][
this
.
getRealIndex
(
i
,
j
)
]
=
tmp
;
this
.
tasks
[
i
][
j
]
=
null
;
this
.
tasks
[
i
][
j
]
=
null
;
}
else
if
(
this
.
tasks
[
i
-
1
].
some
(
element
=>
element
?.
type
==
'final'
||
element
?.
type
==
'repeat'
))
{
}
else
if
(
this
.
tasks
[
i
-
1
].
some
(
element
=>
element
?.
type
==
'final'
||
element
?.
type
==
'repeat'
))
{
if
(
this
.
tasks
[
i
][
j
]?.
type
==
'final'
||
this
.
tasks
[
i
][
j
]?.
type
==
'repeat'
)
{
if
(
this
.
tasks
[
i
][
j
]?.
type
==
'final'
||
this
.
tasks
[
i
][
j
]?.
type
==
'repeat'
)
{
...
@@ -101,7 +101,7 @@ export class Role {
...
@@ -101,7 +101,7 @@ export class Role {
this
.
tasks
[
i
+
2
]
=
[];
this
.
tasks
[
i
+
2
]
=
[];
}
}
if
(
!
(
this
.
tasks
[
i
+
1
].
some
(
element
=>
element
instanceof
Task
)))
{
if
(
!
(
this
.
tasks
[
i
+
1
].
some
(
element
=>
element
instanceof
Task
)))
{
this
.
tasks
[
i
+
1
][
j
]
=
tmp
;
this
.
tasks
[
i
+
1
][
this
.
getRealIndex
(
i
,
j
)
]
=
tmp
;
this
.
tasks
[
i
][
j
]
=
null
;
this
.
tasks
[
i
][
j
]
=
null
;
}
else
if
(
this
.
tasks
[
i
+
1
].
some
(
element
=>
element
?.
type
==
'final'
||
element
?.
type
==
'repeat'
))
{
}
else
if
(
this
.
tasks
[
i
+
1
].
some
(
element
=>
element
?.
type
==
'final'
||
element
?.
type
==
'repeat'
))
{
if
(
this
.
tasks
[
i
][
j
]?.
type
==
'final'
||
this
.
tasks
[
i
][
j
]?.
type
==
'repeat'
)
{
if
(
this
.
tasks
[
i
][
j
]?.
type
==
'final'
||
this
.
tasks
[
i
][
j
]?.
type
==
'repeat'
)
{
...
@@ -154,38 +154,8 @@ export class Role {
...
@@ -154,38 +154,8 @@ export class Role {
return
res
;
return
res
;
}
}
/*
getRealIndex
(
i
:
number
,
j
:
number
):
number
{
getRealIndex
(
i
:
number
,
j
:
number
):
number
{
let
realj
:
number
=
0
;
let
realj
:
number
=
0
;
let index: number = 0;
while (index < j) {
let task: Task|null = this.tasks[i][index];
if (task instanceof Task) {
if (task.durationUnit == 'UT') {
if (task.duration <= 10) {
index = index+task.duration;
realj++;
} else {
index = index + 10;
realj++;
}
} else {
realj++;
index++;
}
} else {
realj++;
index++;
}
}
return realj;
}
*/
getRealIndex
(
i
:
number
,
j
:
number
):
number
{
let
realj
:
number
=
0
;
for
(
let
k
=
0
;
k
<
j
;
k
++
)
{
for
(
let
k
=
0
;
k
<
j
;
k
++
)
{
let
task
:
Task
|
null
=
this
.
tasks
[
i
][
k
];
let
task
:
Task
|
null
=
this
.
tasks
[
i
][
k
];
if
(
task
instanceof
Task
)
{
if
(
task
instanceof
Task
)
{
...
@@ -202,7 +172,6 @@ export class Role {
...
@@ -202,7 +172,6 @@ export class Role {
realj
++
;
realj
++
;
}
}
}
}
return
realj
;
return
realj
;
}
}
...
...
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