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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
5908057f
Commit
5908057f
authored
Apr 26, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: mat store log
parent
b826b116
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
34 deletions
+13
-34
src/valtioStores/matStore/store.ts
src/valtioStores/matStore/store.ts
+13
-34
No files found.
src/valtioStores/matStore/store.ts
View file @
5908057f
...
...
@@ -34,31 +34,26 @@ class CardArray extends Array<CardState> implements ArrayCardState {
counters
:
{},
idleInteractivities
:
[],
});
// methods
remove
(
sequence
:
number
)
{
console
.
warn
(
"
remove
"
,
{
sequence
,
/** 内部输出一些注释,等稳定了再移除这个log */
private
logInside
(
name
:
string
,
obj
:
Record
<
string
,
any
>
)
{
console
.
warn
(
"
matStore
"
,
name
,
{
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
...
obj
,
});
}
// methods
remove
(
sequence
:
number
)
{
this
.
logInside
(
"
remove
"
,
{
sequence
});
this
.
splice
(
sequence
,
1
);
}
async
insert
(
sequence
:
number
,
id
:
number
)
{
console
.
warn
(
"
insert
"
,
{
sequence
,
id
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
.
logInside
(
"
insert
"
,
{
sequence
,
id
});
const
card
=
await
this
.
genCard
(
this
.
getController
(),
id
);
this
.
splice
(
sequence
,
0
,
card
);
}
async
add
(
ids
:
number
[])
{
console
.
warn
(
"
add
"
,
{
ids
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
.
logInside
(
"
add
"
,
{
ids
});
const
cards
=
await
Promise
.
all
(
ids
.
map
(
async
(
id
)
=>
this
.
genCard
(
this
.
getController
(),
id
))
);
...
...
@@ -69,13 +64,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
id
:
number
,
position
?:
ygopro
.
CardPosition
)
{
console
.
warn
(
"
setOccupant
"
,
{
sequence
,
id
,
position
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
.
logInside
(
"
setOccupant
"
,
{
sequence
,
id
,
position
});
const
meta
=
await
fetchCard
(
id
);
const
target
=
this
[
sequence
];
target
.
occupant
=
meta
;
...
...
@@ -87,24 +76,14 @@ class CardArray extends Array<CardState> implements ArrayCardState {
sequence
:
number
,
interactivity
:
CardState
[
"
idleInteractivities
"
][
number
]
)
{
console
.
warn
(
"
addIdleInteractivity
"
,
{
sequence
,
interactivity
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
.
logInside
(
"
addIdleInteractivity
"
,
{
sequence
,
interactivity
});
this
[
sequence
].
idleInteractivities
.
push
(
interactivity
);
}
clearIdleInteractivities
()
{
this
.
forEach
((
card
)
=>
(
card
.
idleInteractivities
=
[]));
}
setPlaceInteractivityType
(
sequence
:
number
,
interactType
:
InteractType
)
{
console
.
warn
(
"
setPlaceInteractivityType
"
,
{
sequence
,
interactType
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
.
logInside
(
"
setPlaceInteractivityType
"
,
{
sequence
,
interactType
});
this
[
sequence
].
placeInteractivity
=
{
interactType
:
interactType
,
response
:
{
...
...
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