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
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
Hide 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 {
...
@@ -34,31 +34,26 @@ class CardArray extends Array<CardState> implements ArrayCardState {
counters
:
{},
counters
:
{},
idleInteractivities
:
[],
idleInteractivities
:
[],
});
});
// methods
/** 内部输出一些注释,等稳定了再移除这个log */
remove
(
sequence
:
number
)
{
private
logInside
(
name
:
string
,
obj
:
Record
<
string
,
any
>
)
{
console
.
warn
(
"
remove
"
,
{
console
.
warn
(
"
matStore
"
,
name
,
{
sequence
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
controller
:
getWhom
(
this
.
getController
()),
...
obj
,
});
});
}
// methods
remove
(
sequence
:
number
)
{
this
.
logInside
(
"
remove
"
,
{
sequence
});
this
.
splice
(
sequence
,
1
);
this
.
splice
(
sequence
,
1
);
}
}
async
insert
(
sequence
:
number
,
id
:
number
)
{
async
insert
(
sequence
:
number
,
id
:
number
)
{
console
.
warn
(
"
insert
"
,
{
this
.
logInside
(
"
insert
"
,
{
sequence
,
id
});
sequence
,
id
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
const
card
=
await
this
.
genCard
(
this
.
getController
(),
id
);
const
card
=
await
this
.
genCard
(
this
.
getController
(),
id
);
this
.
splice
(
sequence
,
0
,
card
);
this
.
splice
(
sequence
,
0
,
card
);
}
}
async
add
(
ids
:
number
[])
{
async
add
(
ids
:
number
[])
{
console
.
warn
(
"
add
"
,
{
this
.
logInside
(
"
add
"
,
{
ids
});
ids
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
const
cards
=
await
Promise
.
all
(
const
cards
=
await
Promise
.
all
(
ids
.
map
(
async
(
id
)
=>
this
.
genCard
(
this
.
getController
(),
id
))
ids
.
map
(
async
(
id
)
=>
this
.
genCard
(
this
.
getController
(),
id
))
);
);
...
@@ -69,13 +64,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
...
@@ -69,13 +64,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
id
:
number
,
id
:
number
,
position
?:
ygopro
.
CardPosition
position
?:
ygopro
.
CardPosition
)
{
)
{
console
.
warn
(
"
setOccupant
"
,
{
this
.
logInside
(
"
setOccupant
"
,
{
sequence
,
id
,
position
});
sequence
,
id
,
position
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
const
meta
=
await
fetchCard
(
id
);
const
meta
=
await
fetchCard
(
id
);
const
target
=
this
[
sequence
];
const
target
=
this
[
sequence
];
target
.
occupant
=
meta
;
target
.
occupant
=
meta
;
...
@@ -87,24 +76,14 @@ class CardArray extends Array<CardState> implements ArrayCardState {
...
@@ -87,24 +76,14 @@ class CardArray extends Array<CardState> implements ArrayCardState {
sequence
:
number
,
sequence
:
number
,
interactivity
:
CardState
[
"
idleInteractivities
"
][
number
]
interactivity
:
CardState
[
"
idleInteractivities
"
][
number
]
)
{
)
{
console
.
warn
(
"
addIdleInteractivity
"
,
{
this
.
logInside
(
"
addIdleInteractivity
"
,
{
sequence
,
interactivity
});
sequence
,
interactivity
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
[
sequence
].
idleInteractivities
.
push
(
interactivity
);
this
[
sequence
].
idleInteractivities
.
push
(
interactivity
);
}
}
clearIdleInteractivities
()
{
clearIdleInteractivities
()
{
this
.
forEach
((
card
)
=>
(
card
.
idleInteractivities
=
[]));
this
.
forEach
((
card
)
=>
(
card
.
idleInteractivities
=
[]));
}
}
setPlaceInteractivityType
(
sequence
:
number
,
interactType
:
InteractType
)
{
setPlaceInteractivityType
(
sequence
:
number
,
interactType
:
InteractType
)
{
console
.
warn
(
"
setPlaceInteractivityType
"
,
{
this
.
logInside
(
"
setPlaceInteractivityType
"
,
{
sequence
,
interactType
});
sequence
,
interactType
,
zone
:
ygopro
.
CardZone
[
this
.
zone
],
controller
:
getWhom
(
this
.
getController
()),
});
this
[
sequence
].
placeInteractivity
=
{
this
[
sequence
].
placeInteractivity
=
{
interactType
:
interactType
,
interactType
:
interactType
,
response
:
{
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