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
77a984a0
Commit
77a984a0
authored
Dec 30, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add removeHand redux
parent
31503a72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
src/reducers/duel/handsSlice.ts
src/reducers/duel/handsSlice.ts
+14
-0
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+3
-0
No files found.
src/reducers/duel/handsSlice.ts
View file @
77a984a0
...
...
@@ -140,6 +140,20 @@ export const addHandsInteractivityImpl: CaseReducer<
}
};
// 删除手牌
export
const
removeHandImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
[
number
,
number
]
>
>
=
(
state
,
action
)
=>
{
const
controler
=
action
.
payload
[
0
];
const
sequence
=
action
.
payload
[
1
];
const
hands
=
judgeSelf
(
controler
,
state
)
?
state
.
meHands
:
state
.
opHands
;
if
(
hands
)
{
hands
.
cards
=
hands
.
cards
.
filter
((
_
,
idx
)
=>
idx
!=
sequence
);
}
};
export
const
selectMeHands
=
(
state
:
RootState
)
=>
state
.
duel
.
meHands
||
{
cards
:
[]
};
export
const
selectOpHands
=
(
state
:
RootState
)
=>
...
...
src/reducers/duel/mod.ts
View file @
77a984a0
...
...
@@ -11,6 +11,7 @@ import {
handsCase
,
clearHandsInteractivityImpl
,
addHandsInteractivityImpl
,
removeHandImpl
,
}
from
"
./handsSlice
"
;
import
{
newTurnImpl
}
from
"
./turnSlice
"
;
import
{
newPhaseImpl
}
from
"
./phaseSlice
"
;
...
...
@@ -84,6 +85,7 @@ const duelSlice = createSlice({
// 手牌相关`Reducer`
clearHandsInteractivity
:
clearHandsInteractivityImpl
,
addHandsInteractivity
:
addHandsInteractivityImpl
,
removeHand
:
removeHandImpl
,
// 怪兽区相关`Reducer`
initMonsters
:
initMonstersImpl
,
...
...
@@ -125,6 +127,7 @@ export const {
initMagics
,
addMagicPlaceSelectAble
,
clearMagicSelectInfo
,
removeHand
,
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
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