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
566ce1a6
Commit
566ce1a6
authored
Jul 03, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
role rewards
parent
9a3ce3f8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
11 deletions
+60
-11
app.component.html
src/app/app.component.html
+1
-1
app.component.ts
src/app/app.component.ts
+42
-0
objective-reward.ts
src/app/class/rewards/objective-reward/objective-reward.ts
+2
-1
quest-reward.ts
src/app/class/rewards/quest-reward/quest-reward.ts
+1
-1
skill-reward.ts
src/app/class/rewards/skill-reward/skill-reward.ts
+1
-0
role.component.html
src/app/pieces/role/role.component.html
+11
-7
role.component.ts
src/app/pieces/role/role.component.ts
+2
-1
No files found.
src/app/app.component.html
View file @
566ce1a6
...
...
@@ -54,7 +54,7 @@
</div>
<div
style=
"display: flex; flex-direction: row;"
>
<app-role
[
style
.
z-index
]="
2
"
[
role
]="
role
"
[
mission
]="
mission
"
[
i
]="
i
"
></app-role>
<app-role
[
style
.
z-index
]="
2
"
[
scenario
]="
scenario
"
[
role
]="
role
"
[
mission
]="
mission
"
[
i
]="
i
"
></app-role>
<div
class=
"container-scenario-main-missions-mission-roles-role-tasks"
[
style
.
z-index
]="
1
"
>
<div
class=
"container-scenario-main-missions-mission-roles-role-tasks-inlineTasks"
*
ngFor=
"let tasks of role.tasks, let i = index"
[
style
.
z-index
]="
role
.
tasks
.
length
+
i
"
>
<div
*
ngFor=
"let task of tasks, let j = index"
[
style
.
z-index
]="
tasks
.
length-j
"
>
...
...
src/app/app.component.ts
View file @
566ce1a6
...
...
@@ -15,6 +15,13 @@ import { SupplementaryRole } from './class/supplementary-role/supplementary-role
import
{
Symbol
}
from
'./class/symbol/symbol'
;
import
{
PieceDetailsService
}
from
'./services/piece-details/piece-details.service'
;
import
{
Comment
}
from
'./class/comment/comment'
;
import
{
Reward
}
from
'./class/rewards/reward'
;
import
{
SkillReward
}
from
'./class/rewards/skill-reward/skill-reward'
;
import
{
CharacterReward
}
from
'./class/rewards/character-reward/character-reward'
;
import
{
QuestReward
}
from
'./class/rewards/quest-reward/quest-reward'
;
import
{
ObjectsReward
}
from
'./class/rewards/objects-reward/objects-reward'
;
import
{
ObjectiveReward
}
from
'./class/rewards/objective-reward/objective-reward'
;
import
{
OtherReward
}
from
'./class/rewards/other-reward/other-reward'
;
@
Component
({
selector
:
'app-root'
,
...
...
@@ -99,6 +106,41 @@ export class AppComponent {
role
.
ressources
=
role
.
ressources
.
map
((
ressourceData
:
any
)
=>
Object
.
assign
(
new
Ressource
(),
ressourceData
));
role
.
occurences
=
role
.
occurences
.
map
((
occurrenceData
:
any
)
=>
Object
.
assign
(
new
RoleOccurrence
(),
occurrenceData
));
role
.
supplementaryRoles
=
role
.
supplementaryRoles
.
map
((
supplementaryRoleData
:
any
)
=>
Object
.
assign
(
new
SupplementaryRole
(),
supplementaryRoleData
));
role
.
rewards
=
role
.
rewards
.
map
((
rewardData
:
any
)
=>
{
if
(
rewardData
.
type
==
'skill'
)
{
return
Object
.
assign
(
new
SkillReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'character'
)
{
return
Object
.
assign
(
new
CharacterReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'quest'
)
{
return
Object
.
assign
(
new
QuestReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'objects'
)
{
return
Object
.
assign
(
new
ObjectsReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'objective'
)
{
return
Object
.
assign
(
new
ObjectiveReward
(),
rewardData
);
}
if
(
rewardData
.
type
==
'other'
)
{
return
Object
.
assign
(
new
OtherReward
(),
rewardData
);
}
});
role
.
rewards
.
forEach
((
reward
:
Reward
,
index
:
number
)
=>
{
if
(
reward
instanceof
SkillReward
)
{
let
i
:
number
=
role
.
ressources
.
findIndex
(
element
=>
element
.
type
==
'attribut'
&&
element
.
name
==
reward
.
skill
.
name
&&
element
.
number
==
reward
.
skill
.
number
);
reward
.
skill
=
role
.
ressources
[
i
];
}
if
(
reward
instanceof
CharacterReward
)
{
let
i
:
number
=
scenario
.
characters
.
findIndex
(
element
=>
element
.
color
==
reward
.
character
.
color
&&
element
.
description
==
reward
.
character
.
description
&&
element
.
name
==
reward
.
character
.
name
);
reward
.
character
=
scenario
.
characters
[
i
];
}
if
(
reward
instanceof
ObjectiveReward
)
{
let
i
:
number
=
role
.
educationnalObjectives
.
findIndex
(
element
=>
element
.
objective
==
reward
.
objective
.
objective
);
reward
.
objective
=
role
.
educationnalObjectives
[
i
];
}
});
role
.
tasks
.
forEach
((
inlineTasks
:
any
[],
index
:
number
)
=>
{
role
.
tasks
[
index
]
=
inlineTasks
.
map
((
taskData
:
any
)
=>
{
if
(
taskData
!==
null
)
{
...
...
src/app/class/rewards/objective-reward/objective-reward.ts
View file @
566ce1a6
import
{
RoleEducationnalObjective
}
from
"../../role-educationnal-objective/role-educationnal-objective"
;
import
{
Reward
}
from
"../reward"
;
export
class
ObjectiveReward
extends
Reward
{
...
...
@@ -6,5 +7,5 @@ export class ObjectiveReward extends Reward {
super
(
'objective'
);
}
name
:
string
=
''
;
objective
!
:
RoleEducationnalObjective
;
}
src/app/class/rewards/quest-reward/quest-reward.ts
View file @
566ce1a6
...
...
@@ -7,5 +7,5 @@ export class QuestReward extends Reward {
super
(
'quest'
);
}
quest
!
:
Role
;
indexQuest
!
:
number
;
}
src/app/class/rewards/skill-reward/skill-reward.ts
View file @
566ce1a6
...
...
@@ -7,5 +7,6 @@ export class SkillReward extends Reward {
super
(
'skill'
);
}
quantity
:
number
=
1
;
skill
!
:
Ressource
;
}
src/app/pieces/role/role.component.html
View file @
566ce1a6
...
...
@@ -60,7 +60,7 @@
</div>
<div
class=
"piece-form-rewards-reward-character"
*
ngIf=
"reward.type == 'character'"
>
<select
[(
ngModel
)]="
getCharacterReward
(
i
).
character
"
>
<option
>
Personnage 1
</option>
<option
[
ngValue
]="
character
"
*
ngFor=
"let character of scenario.characters"
>
{{character.name}}
</option>
</select>
<button
mat-button
(
click
)="
removeReward
(
i
)"
><mat-icon
fontIcon=
"remove"
></mat-icon></button>
</div>
...
...
@@ -73,21 +73,25 @@
</div>
-->
<div
class=
"piece-form-rewards-reward-skill"
*
ngIf=
"reward.type == 'skill'"
>
<input
type=
"number"
/>
<input
type=
"number"
[(
ngModel
)]="
getSkillReward
(
i
).
quantity
"
/>
<select
[(
ngModel
)]="
getSkillReward
(
i
).
skill
"
>
<option>
Compétence 1
</option>
<ng-container
*
ngFor=
"let skill of role.ressources"
>
<option
[
ngValue
]="
skill
"
*
ngIf=
"skill.type == 'attribut'"
>
{{skill.name}}
</option>
</ng-container>
</select>
<button
mat-button
(
click
)="
removeReward
(
i
)"
><mat-icon
fontIcon=
"remove"
></mat-icon></button>
</div>
<div
class=
"piece-form-rewards-reward-quest"
*
ngIf=
"reward.type == 'quest'"
>
<select
[(
ngModel
)]="
getQuestReward
(
i
).
quest
"
>
<option>
Quête 1
</option>
<select
[(
ngModel
)]="
getQuestReward
(
i
).
indexQuest
"
>
<ng-container
*
ngFor=
"let quest of mission.roles; let index = index"
>
<option
[
ngValue
]="
index
"
*
ngIf=
"i != index"
>
{{quest.intitule ? quest.intitule : 'Role '+(index+1)}}
</option>
</ng-container>
</select>
<button
mat-button
(
click
)="
removeReward
(
i
)"
><mat-icon
fontIcon=
"remove"
></mat-icon></button>
</div>
<div
class=
"piece-form-rewards-reward-objective"
*
ngIf=
"reward.type == 'objective'"
>
<select
[(
ngModel
)]="
getObjectiveReward
(
i
).
nam
e
"
>
<option
>
Objectif pédagoqique 1
</option>
<select
[(
ngModel
)]="
getObjectiveReward
(
i
).
objectiv
e
"
>
<option
[
ngValue
]="
objective
"
*
ngFor=
"let objective of role.educationnalObjectives"
>
{{objective.objective}}
</option>
</select>
<button
mat-button
(
click
)="
removeReward
(
i
)"
><mat-icon
fontIcon=
"remove"
></mat-icon></button>
</div>
...
...
src/app/pieces/role/role.component.ts
View file @
566ce1a6
...
...
@@ -6,10 +6,10 @@ import { ObjectiveReward } from 'src/app/class/rewards/objective-reward/objectiv
import
{
ObjectsReward
}
from
'src/app/class/rewards/objects-reward/objects-reward'
;
import
{
OtherReward
}
from
'src/app/class/rewards/other-reward/other-reward'
;
import
{
QuestReward
}
from
'src/app/class/rewards/quest-reward/quest-reward'
;
import
{
Reward
}
from
'src/app/class/rewards/reward'
;
import
{
SkillReward
}
from
'src/app/class/rewards/skill-reward/skill-reward'
;
import
{
RoleEducationnalObjective
}
from
'src/app/class/role-educationnal-objective/role-educationnal-objective'
;
import
{
Role
}
from
'src/app/class/role/role'
;
import
{
Scenario
}
from
'src/app/class/scenario/scenario'
;
import
{
SupplementaryRole
}
from
'src/app/class/supplementary-role/supplementary-role'
;
import
{
PieceDetailsService
}
from
'src/app/services/piece-details/piece-details.service'
;
...
...
@@ -20,6 +20,7 @@ import { PieceDetailsService } from 'src/app/services/piece-details/piece-detail
})
export
class
RoleComponent
implements
OnInit
{
@
Input
()
scenario
:
Scenario
=
new
Scenario
();
@
Input
()
role
:
Role
=
new
Role
();
@
Input
()
mission
:
Mission
=
new
Mission
();
@
Input
()
i
:
number
=
0
;
...
...
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