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
98b281d7
Commit
98b281d7
authored
Nov 19, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add navigatin
parent
be7512d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+4
-0
src/ui/Mora.tsx
src/ui/Mora.tsx
+10
-0
No files found.
src/reducers/duel/mod.ts
View file @
98b281d7
...
...
@@ -6,6 +6,7 @@
import
{
createSlice
}
from
"
@reduxjs/toolkit
"
;
import
{
InitInfo
,
meInfoInitImpl
,
opInfoInitImpl
}
from
"
./initInfoSlice
"
;
import
{
Hands
,
meAddHandsImpl
,
opAddHandsImpl
}
from
"
./handsSlice
"
;
import
{
RootState
}
from
"
../../store
"
;
export
interface
DuelState
{
meInitInfo
?:
InitInfo
;
// 自己的初始状态
...
...
@@ -29,4 +30,7 @@ const duelSlice = createSlice({
export
const
{
meInfoInit
,
opInfoInit
,
meAddHands
,
opAddHands
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
};
export
default
duelSlice
.
reducer
;
src/ui/Mora.tsx
View file @
98b281d7
...
...
@@ -14,7 +14,10 @@ import {
unSelectTpAble
,
}
from
"
../reducers/moraSlice
"
;
import
{
selectPlayer0
,
selectPlayer1
}
from
"
../reducers/playerSlice
"
;
import
{
selectDuelHsStart
}
from
"
../reducers/duel/mod
"
;
import
{
store
}
from
"
../store
"
;
import
{
useEffect
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
// TODO: 应该展示聊天信息
export
default
function
Mora
()
{
...
...
@@ -23,6 +26,13 @@ export default function Mora() {
const
selectTpAble
=
useAppSelector
(
selectTpSelectAble
);
const
player0
=
useAppSelector
(
selectPlayer0
);
const
player1
=
useAppSelector
(
selectPlayer1
);
const
duelHsStart
=
useAppSelector
(
selectDuelHsStart
);
useEffect
(()
=>
{
if
(
duelHsStart
)
{
useNavigate
()(
"
/duel
"
);
}
},
[
duelHsStart
]);
const
handleSelectScissors
=
()
=>
{
sendHandResult
(
"
scissors
"
);
...
...
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