Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
75fb7df5
Commit
75fb7df5
authored
Dec 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5bff6b16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
getChapter.ts
egret/src/something/chapters/getChapter.ts
+25
-25
No files found.
egret/src/something/chapters/getChapter.ts
View file @
75fb7df5
...
...
@@ -52,30 +52,30 @@ var a = {
"three"
:
32000
};
//取数据格式用,一般情况注释
//
(function exportFile(chapters: ChapterData[]) {
//
var obj = []
//
for (var i = 1; i < chapters.length; i++) {
//
var chapter: ChapterData = chapters[i]
//
var target: PassTargetData = chapter.passTarget
//
var a: any = {};
//
a["lev"] = i;
//
a["tar"] = [];
//
if (target.type == PassType.SCORE_TARGET) {
//
a["tar"].push({ "type": 1, "num": target.score })
//
} else {
//
for (var j = 0; j < target.elements.length; j++) {
//
var element = target.elements[j];
//
a["tar"].push({ "type": submitTran[element.type], "num": element.count })
//
}
//
}
//
取数据格式用,一般情况注释
(
function
exportFile
(
chapters
:
ChapterData
[])
{
var
obj
=
[]
for
(
var
i
=
1
;
i
<
chapters
.
length
;
i
++
)
{
var
chapter
:
ChapterData
=
chapters
[
i
]
var
target
:
PassTargetData
=
chapter
.
passTarget
var
a
:
any
=
{};
a
[
"lev"
]
=
i
;
a
[
"tar"
]
=
[];
if
(
target
.
type
==
PassType
.
SCORE_TARGET
)
{
a
[
"tar"
].
push
({
"type"
:
1
,
"num"
:
target
.
score
})
}
else
{
for
(
var
j
=
0
;
j
<
target
.
elements
.
length
;
j
++
)
{
var
element
=
target
.
elements
[
j
];
a
[
"tar"
].
push
({
"type"
:
submitTran
[
element
.
type
],
"num"
:
element
.
count
})
}
}
//
a["one"] = chapter.starScores[0];
//
a["two"] = chapter.starScores[1];
//
a["three"] = chapter.starScores[2];
a
[
"one"
]
=
chapter
.
starScores
[
0
];
a
[
"two"
]
=
chapter
.
starScores
[
1
];
a
[
"three"
]
=
chapter
.
starScores
[
2
];
// obj.push(a)
// }
// var file = new File([JSON.stringify(obj)], "cfg.json", { type: "text/plain;charset=utf-8" });
// window["saveAs"](file);
// })(chapters)
\ No newline at end of file
obj
.
push
(
a
)
}
var
file
=
new
File
([
JSON
.
stringify
(
obj
)],
"cfg.json"
,
{
type
:
"text/plain;charset=utf-8"
});
window
[
"saveAs"
](
file
);
})(
chapters
)
\ No newline at end of file
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