Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WorkAdventure Dialogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FS Info TU Dortmund
Events
WorkAdventure Dialogs
Commits
dc7295dd
Commit
dc7295dd
authored
4 years ago
by
Jonas Zohren
Browse files
Options
Downloads
Patches
Plain Diff
Collect all facts in dialogSet for debugger
parent
6eaa605b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Debugger.svelte
+15
-2
15 additions, 2 deletions
src/Debugger.svelte
with
15 additions
and
2 deletions
src/Debugger.svelte
+
15
−
2
View file @
dc7295dd
...
...
@@ -8,10 +8,23 @@
$
:
dialogNames
=
Object
.
keys
(
dialogSet
.
dialogs
)
export
let
selectedDialogName
:
string
/**
* Collect all facts referenced in these dialogs
*/
function
getDialogFacts
(
dialogMap
:
DialogMap
):
String
[]
{
const
dialogs
=
[];
const
dialogs
:
Dialog
[]
=
[];
for
(
const
dmKey
of
Object
.
keys
(
dialogMap
))
dialogs
.
push
(
dialogMap
[
dmKey
]);
return
dialogs
.
map
(
dialog
=>
[...(
dialog
.
addFacts
||
[]),
...(
dialog
.
removeFacts
||
[])]).
flat
()
const
allFacts
=
dialogs
.
map
((
dialog
)
=>
[
...(
dialog
.
addFacts
||
[]),
...(
dialog
.
removeFacts
||
[]),
...
dialog
.
options
.
map
((
opt
)
=>
opt
.
requiredFacts
).
flat
(),
...
dialog
.
options
.
map
((
opt
)
=>
opt
.
forbiddenFacts
).
flat
(),
])
.
flat
();
// Deduplicate entries
const
factsSet
=
new
Set
(
allFacts
);
return
[...
factsSet
];
}
let
seenFactIds
=
new
Set
<
String
>
([...
$gameFactsStore
,
...
getDialogFacts
(
dialogSet
.
dialogs
)]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment