Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
babycare_xiaoxiao
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
翁阳
babycare_xiaoxiao
Commits
b4735776
Commit
b4735776
authored
Jul 24, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
2c8b7486
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
136 additions
and
35 deletions
+136
-35
workspace.xml
.idea/workspace.xml
+41
-27
answer.js
answer.js
+86
-0
babycare.consumerTools.json
mock/miniTb/babycare.consumerTools.json
+3
-3
babycare.getGameInfo.json
mock/miniTb/babycare.getGameInfo.json
+2
-2
SuccessNoPrizePanel.ts
src/panels/SuccessNoPrizePanel.ts
+2
-2
MapScene.ts
src/scene/map/MapScene.ts
+2
-1
No files found.
.idea/workspace.xml
View file @
b4735776
This diff is collapsed.
Click to expand it.
answer.js
0 → 100644
View file @
b4735776
function
ListNode
(
value
,
next
,
last
)
{
this
.
value
=
value
;
this
.
next
=
next
;
this
.
last
=
last
;
}
ListNode
.
prototype
.
value
=
null
;
ListNode
.
prototype
.
next
=
null
;
ListNode
.
prototype
.
last
=
null
;
function
List
()
{
}
List
.
prototype
.
head
=
null
;
List
.
prototype
.
tail
=
null
;
List
.
prototype
.
length
=
null
;
List
.
prototype
.
getNodeByIndex
=
function
(
index
=
0
)
{
if
(
index
<
-
this
.
length
||
index
>=
this
.
length
)
{
console
.
error
(
'out of range'
);
return
null
;
}
if
(
index
===
0
||
index
===
-
this
.
length
)
{
return
this
.
head
;
}
else
if
(
index
===
this
.
length
-
1
||
index
===
-
1
)
{
return
this
.
tail
;
}
else
if
(
index
>
0
)
{
let
last
=
this
.
head
;
for
(
let
i
=
1
;
i
<=
index
;
i
++
)
{
last
=
last
.
next
;
}
return
last
;
}
else
if
(
index
<
0
)
{
let
next
=
this
.
tail
;
for
(
let
i
=
-
2
;
i
>=
index
;
i
--
)
{
next
=
next
.
last
;
}
return
next
;
}
}
List
.
prototype
.
increase
=
function
(
value
,
index
=
this
.
length
-
1
)
{
const
opNode
=
this
.
getNodeByIndex
(
index
);
if
(
!
opNode
)
{
return
;
}
opNode
.
value
+=
value
;
if
(
opNode
.
value
>=
10
)
{
const
out
=
~~
(
opNode
.
value
/
10
);
opNode
.
value
=
opNode
.
value
%
10
;
this
.
increase
(
out
,
index
-
1
);
}
}
List
.
createList
=
function
(...
value
)
{
const
newList
=
new
List
();
let
last
=
new
ListNode
(
value
[
0
],
null
,
null
);
newList
.
head
=
last
;
for
(
let
i
=
1
;
i
<
value
.
length
;
i
++
)
{
let
newNode
=
new
ListNode
(
value
[
i
],
null
,
last
);
last
.
next
=
newNode
;
last
=
newNode
;
}
newList
.
tail
=
last
;
newList
.
length
=
value
.
length
;
return
newList
;
}
const
list
=
List
.
createList
(
1
,
2
,
3
,
4
);
list
.
increase
(
10
,
2
);
mock/miniTb/babycare.consumerTools.json
View file @
b4735776
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
"data"
:
{
"data"
:
{
"tools"
:
{
"tools"
:
{
"HAMMERS"
:
1
,
"HAMMERS"
:
1
,
"STEPS"
:
0
,
"STEPS"
:
1
,
"BOOMS"
:
0
"BOOMS"
:
1
}
}
},
},
"success"
:
true
,
"success"
:
true
,
...
...
mock/miniTb/babycare.getGameInfo.json
View file @
b4735776
...
@@ -53,8 +53,8 @@
...
@@ -53,8 +53,8 @@
"power"
:
3
,
"power"
:
3
,
"tools"
:
{
"tools"
:
{
"HAMMERS"
:
1
,
"HAMMERS"
:
1
,
"STEPS"
:
0
,
"STEPS"
:
1
,
"BOOMS"
:
0
"BOOMS"
:
1
},
},
"topAward"
:
""
"topAward"
:
""
},
},
...
...
src/panels/SuccessNoPrizePanel.ts
View file @
b4735776
...
@@ -79,9 +79,9 @@ export class SuccessNoPrizePanel extends Panel {
...
@@ -79,9 +79,9 @@ export class SuccessNoPrizePanel extends Panel {
if
(
curLevel
<=
value
&&
d
>=
0
&&
d
<=
dLevel
)
{
if
(
curLevel
<=
value
&&
d
>=
0
&&
d
<=
dLevel
)
{
upLevel
=
value
;
upLevel
=
value
;
if
(
curLevel
==
this
.
data
.
level
)
{
if
(
curLevel
==
this
.
data
.
level
)
{
dLevel
=
d
+
1
;
}
else
{
dLevel
=
d
;
dLevel
=
d
;
}
else
{
dLevel
=
d
+
1
;
}
}
}
}
});
});
...
...
src/scene/map/MapScene.ts
View file @
b4735776
...
@@ -62,7 +62,8 @@ export class MapScene extends Scene {
...
@@ -62,7 +62,8 @@ export class MapScene extends Scene {
let
openPrize
=
GTool
.
readCache
(
'openPrize'
);
let
openPrize
=
GTool
.
readCache
(
'openPrize'
);
if
(
Tools
.
gameData
.
topAward
&&
Tools
.
gameData
.
topAward
.
_id
&&
openPrize
!==
'true'
)
{
if
(
Tools
.
gameData
.
topAward
&&
Tools
.
gameData
.
topAward
.
_id
&&
openPrize
!==
'true'
)
{
GTool
.
writeCache
(
'openPrize'
,
'true'
);
GTool
.
writeCache
(
'openPrize'
,
'true'
);
showPanel
(
PrizePanel
,
Tools
.
gameData
.
topAward
);
showPanel
(
PrizePanel
,
JSON
.
parse
(
JSON
.
stringify
(
Tools
.
gameData
.
topAward
)));
Tools
.
gameData
.
topAward
=
null
;
}
}
}
}
...
...
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