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
baichixing
Neos
Commits
9d8825d3
Commit
9d8825d3
authored
Apr 29, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update store
parent
cfd5585e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
src/service/duel/reloadField.ts
src/service/duel/reloadField.ts
+1
-1
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+3
-3
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+15
-1
No files found.
src/service/duel/reloadField.ts
View file @
9d8825d3
...
...
@@ -42,7 +42,7 @@ function reloadDuelField(
return
{
location
:
{
controler
:
controller
,
location
:
action
.
zone
,
zone
:
action
.
zone
,
position
:
action
.
position
,
},
idleInteractivities
:
[],
...
...
src/stores/matStore/store.ts
View file @
9d8825d3
...
...
@@ -32,7 +32,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
occupant
:
await
fetchCard
(
id
,
true
),
location
:
{
controler
:
controller
,
location
:
this
.
zone
,
zone
:
this
.
zone
,
position
:
position
==
undefined
?
ygopro
.
CardPosition
.
FACEUP_ATTACK
:
position
,
},
...
...
@@ -127,12 +127,12 @@ const isMe = (controller: number): boolean => {
/**
* 生成一个指定长度的卡片数组
*/
const
genBlock
=
(
location
:
ygopro
.
CardZone
,
n
:
number
)
=>
const
genBlock
=
(
zone
:
ygopro
.
CardZone
,
n
:
number
)
=>
Array
(
n
)
.
fill
(
null
)
.
map
((
_
)
=>
({
location
:
{
location
,
zone
,
},
idleInteractivities
:
[],
counters
:
{},
...
...
src/stores/matStore/types.ts
View file @
9d8825d3
...
...
@@ -109,7 +109,7 @@ export interface CardState {
occupant
?:
CardMeta
;
// 占据此位置的卡牌元信息
location
:
{
controler
?:
number
;
// 控制这个位置的玩家,0或1
location
:
ygopro
.
CardZone
;
// 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区
zone
:
ygopro
.
CardZone
;
// 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区
position
?:
ygopro
.
CardPosition
;
// 卡片的姿势:攻击还是守备
};
// 位置信息,叫location的原因是为了和ygo对齐
idleInteractivities
:
Interactivity
<
number
>
[];
// IDLE状态下的互动信息
...
...
@@ -123,6 +123,20 @@ export interface CardState {
reload
?:
boolean
;
// 这个字段会在收到MSG_RELOAD_FIELD的时候设置成true,在收到MSG_UPDATE_DATE的时候设置成false
}
export
interface
BlockState
{
// 位置信息
location
:
{
controller
:
number
;
zone
:
ygopro
.
CardZone
;
};
// 选择位置状态下的互动信息
placeInteractivity
?:
Interactivity
<
{
controler
:
number
;
zone
:
ygopro
.
CardZone
;
sequence
:
number
;
}
>
;
}
export
interface
Interactivity
<
T
>
{
interactType
:
InteractType
;
// 如果`interactType`是`ACTIVATE`,这个字段是对应的效果编号
...
...
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