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
6501b7de
Commit
6501b7de
authored
Apr 24, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix extendState
parent
f96af3a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
10 deletions
+17
-10
src/reducers/duel/banishedZoneSlice.ts
src/reducers/duel/banishedZoneSlice.ts
+2
-3
src/reducers/duel/cemeretySlice.ts
src/reducers/duel/cemeretySlice.ts
+2
-3
src/reducers/duel/extraDeckSlice.ts
src/reducers/duel/extraDeckSlice.ts
+1
-2
src/reducers/duel/generic.ts
src/reducers/duel/generic.ts
+12
-2
No files found.
src/reducers/duel/banishedZoneSlice.ts
View file @
6501b7de
...
...
@@ -54,15 +54,14 @@ export const banishedZoneCase = (
location
:
{
controler
,
location
:
ygopro
.
CardZone
.
REMOVED
,
sequence
,
},
idleInteractivities
:
[],
counters
:
{},
};
if
(
judgeSelf
(
controler
,
state
))
{
extendState
(
state
.
meBanishedZone
,
newExclusion
);
extendState
(
state
.
meBanishedZone
,
newExclusion
,
sequence
);
}
else
{
extendState
(
state
.
opBanishedZone
,
newExclusion
);
extendState
(
state
.
opBanishedZone
,
newExclusion
,
sequence
);
}
});
builder
.
addCase
(
fetchBanishedZoneMeta
.
fulfilled
,
(
state
,
action
)
=>
{
...
...
src/reducers/duel/cemeretySlice.ts
View file @
6501b7de
...
...
@@ -52,15 +52,14 @@ export const graveyardCase = (builder: ActionReducerMapBuilder<DuelState>) => {
location
:
{
controler
,
location
:
ygopro
.
CardZone
.
GRAVE
,
sequence
,
},
idleInteractivities
:
[],
counters
:
{},
};
if
(
judgeSelf
(
controler
,
state
))
{
extendState
(
state
.
meGraveyard
,
newGraveyard
);
extendState
(
state
.
meGraveyard
,
newGraveyard
,
sequence
);
}
else
{
extendState
(
state
.
opGraveyard
,
newGraveyard
);
extendState
(
state
.
opGraveyard
,
newGraveyard
,
sequence
);
}
});
builder
.
addCase
(
fetchGraveyardMeta
.
fulfilled
,
(
state
,
action
)
=>
{
...
...
src/reducers/duel/extraDeckSlice.ts
View file @
6501b7de
...
...
@@ -64,7 +64,6 @@ export const extraDeckCase = (builder: ActionReducerMapBuilder<DuelState>) => {
location
:
{
controler
,
location
:
ygopro
.
CardZone
.
EXTRA
,
sequence
,
},
idleInteractivities
:
[],
counters
:
{},
...
...
@@ -72,7 +71,7 @@ export const extraDeckCase = (builder: ActionReducerMapBuilder<DuelState>) => {
const
extraDeck
=
judgeSelf
(
controler
,
state
)
?
state
.
meExtraDeck
:
state
.
opExtraDeck
;
extendState
(
extraDeck
,
newExtraDeck
);
extendState
(
extraDeck
,
newExtraDeck
,
sequence
);
});
builder
.
addCase
(
fetchExtraDeckMeta
.
fulfilled
,
(
state
,
action
)
=>
{
const
controler
=
action
.
payload
.
controler
;
...
...
src/reducers/duel/generic.ts
View file @
6501b7de
...
...
@@ -129,12 +129,22 @@ export function createAsyncRepeatedMetaThunk(
);
}
/*
* 扩充决斗区域卡片内容
*
* @param state - 需要扩充的区域,比如`MonsterState`
* @param newState - 新增加的`CardState`
* @sequence - 新增加的卡片的序列号,可选,如果为空则补充到列表末尾
*
* */
export
function
extendState
<
T
extends
DuelFieldState
>
(
state
:
T
|
undefined
,
newState
:
CardState
newState
:
CardState
,
sequence
?:
number
)
{
if
(
state
)
{
state
.
inner
.
push
(
newState
);
let
index
=
sequence
!==
undefined
?
sequence
:
state
.
inner
.
length
;
state
.
inner
.
splice
(
index
,
0
,
newState
);
}
}
...
...
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