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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
love_飞影
Neos
Commits
7de528a2
Commit
7de528a2
authored
Jun 30, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle MsgHandResult
parent
f0dd5248
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
src/service/duel/handResult.ts
src/service/duel/handResult.ts
+5
-2
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+8
-0
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+11
-0
No files found.
src/service/duel/handResult.ts
View file @
7de528a2
import
{
ygopro
}
from
"
@/api
"
;
import
{
matStore
}
from
"
@/stores
"
;
import
MsgHandResult
=
ygopro
.
StocGameMessage
.
MsgHandResult
;
export
default
(
res
:
MsgHandResult
)
=>
{
console
.
log
(
res
);
// TODO
const
{
result1
,
result2
}
=
res
;
matStore
.
handResults
.
set
(
0
,
result1
);
matStore
.
handResults
.
set
(
1
,
result2
);
};
src/stores/matStore/store.ts
View file @
7de528a2
...
...
@@ -81,6 +81,14 @@ export const matStore: MatState = proxy<MatState>({
enableEp
:
false
,
// 允许回合结束
},
unimplemented
:
0
,
handResults
:
{
me
:
0
,
op
:
0
,
of
:
(
controller
:
number
)
=>
matStore
.
handResults
[
getWhom
(
controller
)],
set
(
controller
,
result
)
{
matStore
.
handResults
[
getWhom
(
controller
)]
=
result
;
},
},
// methods
isMe
,
});
...
...
src/stores/matStore/types.ts
View file @
7de528a2
...
...
@@ -37,6 +37,10 @@ export interface MatState {
tossResult
?:
string
;
// 骰子/硬币结果
handResults
:
BothSide
<
HandResult
>
&
{
set
:
(
controller
:
number
,
result
:
HandResult
)
=>
void
;
};
// 猜拳结果
/** 根据自己的先后手判断是否是自己 */
isMe
:
(
player
:
number
)
=>
boolean
;
}
...
...
@@ -94,4 +98,11 @@ export interface PhaseState {
enableM2
:
boolean
;
// 允许进入M2阶段
enableEp
:
boolean
;
// 允许回合结束
}
export
enum
HandResult
{
UNKNOWN
=
0
,
SCISSOR
=
1
,
ROCK
=
2
,
PAPER
=
3
,
}
// <<< play mat state <<<
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