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
24a8038d
Commit
24a8038d
authored
May 28, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix shuffle hand
parent
2106d11a
Pipeline
#21951
passed with stages
in 15 minutes and 13 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/service/duel/shuffleHand.ts
src/service/duel/shuffleHand.ts
+14
-6
No files found.
src/service/duel/shuffleHand.ts
View file @
24a8038d
...
...
@@ -8,25 +8,33 @@ export default (shuffleHand: MsgShuffleHand) => {
// 本质上是要将手卡的sequence变成和codes一样的顺序
const
hands
=
cardStore
.
at
(
ygopro
.
CardZone
.
HAND
,
controller
);
const
t
:
Record
<
number
,
number
[]
>
=
{}
;
const
t
:
Map
<
number
,
number
[]
>
=
new
Map
([])
;
codes
.
forEach
((
code
,
sequence
)
=>
{
t
[
code
]
=
t
[
code
]
||
[];
t
[
code
].
push
(
sequence
);
const
v
=
t
.
get
(
code
);
if
(
v
)
{
v
.
push
(
sequence
);
}
else
{
t
.
set
(
code
,
[
sequence
]);
}
});
console
.
log
(
t
);
hands
.
forEach
((
hand
)
=>
{
const
target
=
t
[
hand
.
code
]
;
const
target
=
t
.
get
(
hand
.
code
)
;
if
(
target
!==
undefined
)
{
const
sequence
=
target
.
shift
();
if
(
sequence
)
{
hand
.
sequence
=
sequence
;
}
else
{
console
.
warn
(
`<ShuffleHand>sequence shift from target is null, controller=
${
controller
}
hands=
${
hands
}
, codes=
${
codes
}
`
`<ShuffleHand>sequence shift from target is null, controller=
${
controller
}
, target=
${
target
}
, codes=
${
codes
}
`
);
}
}
else
{
console
.
warn
(
`<ShuffleHand>target from records is null, controller=
${
controller
}
hands=
${
hands
}
, codes=
${
codes
}
`
`<ShuffleHand>target from records is null, controller=
${
controller
}
, hands=
${
hands
.
map
(
(
hand
)
=>
hand
.
code
)}
, codes=
${
codes
}
`
);
}
});
...
...
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