Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
5220b672
Commit
5220b672
authored
Jun 03, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix shuffle hand
parent
42d4cf52
Pipeline
#22083
passed with stages
in 16 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
src/service/duel/shuffleHand.ts
src/service/duel/shuffleHand.ts
+10
-9
No files found.
src/service/duel/shuffleHand.ts
View file @
5220b672
...
...
@@ -8,20 +8,21 @@ export default (shuffleHand: MsgShuffleHand) => {
// 本质上是要将手卡的sequence变成和codes一样的顺序
const
hands
=
cardStore
.
at
(
ygopro
.
CardZone
.
HAND
,
controller
);
const
hash
=
[...
codes
].
reduce
(
(
hash
,
code
,
sequence
)
=>
hash
.
set
(
code
,
sequence
),
new
Map
()
);
const
hash
=
new
Map
(
codes
.
map
((
code
)
=>
[
code
,
new
Array
()]));
codes
.
forEach
((
code
,
sequence
)
=>
{
hash
.
get
(
code
)?.
push
(
sequence
);
}
);
hands
.
forEach
((
hand
)
=>
{
const
sequence
=
hash
.
get
(
hand
.
code
);
if
(
sequence
!==
undefined
)
{
if
(
sequence
>=
0
)
{
const
sequences
=
hash
.
get
(
hand
.
code
);
if
(
sequences
!==
undefined
)
{
const
sequence
=
sequences
.
pop
();
if
(
sequence
!==
undefined
)
{
hand
.
location
.
sequence
=
sequence
;
hash
.
set
(
hand
.
code
,
sequence
-
1
);
hash
.
set
(
hand
.
code
,
sequence
s
);
}
else
{
console
.
warn
(
`<ShuffleHand>sequence
less than zero
, controller=
${
controller
}
, code=
${
hand
.
code
}
, sequence=
${
sequence
}
`
`<ShuffleHand>sequence
poped is none
, controller=
${
controller
}
, code=
${
hand
.
code
}
, sequence=
${
sequence
}
`
);
}
}
else
{
...
...
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