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
d6f16bf0
Commit
d6f16bf0
authored
Aug 06, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix matStore compile error
parent
42a9b174
Pipeline
#22927
failed with stages
in 15 minutes and 46 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
21 deletions
+28
-21
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+27
-18
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+1
-3
No files found.
src/stores/matStore/store.ts
View file @
d6f16bf0
...
@@ -3,6 +3,7 @@ import { proxy } from "valtio";
...
@@ -3,6 +3,7 @@ import { proxy } from "valtio";
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
type
NeosStore
}
from
"
../shared
"
;
import
{
ChainSetting
,
InitInfo
,
MatState
}
from
"
./types
"
;
import
{
ChainSetting
,
InitInfo
,
MatState
}
from
"
./types
"
;
/**
/**
...
@@ -53,8 +54,6 @@ const initInfo: MatState["initInfo"] = proxy({
...
@@ -53,8 +54,6 @@ const initInfo: MatState["initInfo"] = proxy({
const
initialState
:
Omit
<
MatState
,
"
reset
"
>
=
{
const
initialState
:
Omit
<
MatState
,
"
reset
"
>
=
{
chains
:
[],
chains
:
[],
chainSetting
:
ChainSetting
.
CHAIN_SMART
,
timeLimits
:
{
timeLimits
:
{
// 时间限制
// 时间限制
me
:
-
1
,
me
:
-
1
,
...
@@ -64,9 +63,7 @@ const initialState: Omit<MatState, "reset"> = {
...
@@ -64,9 +63,7 @@ const initialState: Omit<MatState, "reset"> = {
matStore
.
timeLimits
[
getWhom
(
controller
)]
=
time
;
matStore
.
timeLimits
[
getWhom
(
controller
)]
=
time
;
},
},
},
},
initInfo
,
initInfo
,
selfType
:
ygopro
.
StocTypeChange
.
SelfType
.
UNKNOWN
,
selfType
:
ygopro
.
StocTypeChange
.
SelfType
.
UNKNOWN
,
hint
:
{
code
:
-
1
},
hint
:
{
code
:
-
1
},
currentPlayer
:
-
1
,
currentPlayer
:
-
1
,
...
@@ -86,22 +83,28 @@ const initialState: Omit<MatState, "reset"> = {
...
@@ -86,22 +83,28 @@ const initialState: Omit<MatState, "reset"> = {
matStore
.
handResults
[
getWhom
(
controller
)]
=
result
;
matStore
.
handResults
[
getWhom
(
controller
)]
=
result
;
},
},
},
},
tossResult
:
undefined
,
chainSetting
:
ChainSetting
.
CHAIN_SMART
,
// methods
// methods
isMe
,
isMe
,
};
};
/**
class
MatStore
implements
MatState
,
NeosStore
{
* 💡 决斗盘状态仓库,本文件核心,
chains
=
initialState
.
chains
;
* 具体介绍可以点进`MatState`去看
chainSetting
=
initialState
.
chainSetting
;
*/
timeLimits
=
initialState
.
timeLimits
;
export
const
matStore
:
MatState
=
proxy
<
MatState
>
({
initInfo
=
initialState
.
initInfo
;
...
initialState
,
selfType
=
initialState
.
selfType
;
reset
()
{
hint
=
initialState
.
hint
;
// const resetObj = _.cloneDeep(initialState);
currentPlayer
=
initialState
.
currentPlayer
;
// Object.keys(resetObj).forEach((key) => {
phase
=
initialState
.
phase
;
// // @ts-ignore
isReplay
=
initialState
.
isReplay
;
// matStore[key] = initialState[key];
unimplemented
=
initialState
.
unimplemented
;
// });
handResults
=
initialState
.
handResults
;
tossResult
=
initialState
.
tossResult
;
// methods
isMe
=
initialState
.
isMe
;
reset
():
void
{
this
.
chains
=
[];
this
.
chains
=
[];
this
.
timeLimits
.
me
=
-
1
;
this
.
timeLimits
.
me
=
-
1
;
this
.
timeLimits
.
op
=
-
1
;
this
.
timeLimits
.
op
=
-
1
;
...
@@ -120,8 +123,14 @@ export const matStore: MatState = proxy<MatState>({
...
@@ -120,8 +123,14 @@ export const matStore: MatState = proxy<MatState>({
this
.
unimplemented
=
0
;
this
.
unimplemented
=
0
;
this
.
handResults
.
me
=
0
;
this
.
handResults
.
me
=
0
;
this
.
handResults
.
op
=
0
;
this
.
handResults
.
op
=
0
;
},
}
});
}
/**
* 💡 决斗盘状态仓库,本文件核心,
* 具体介绍可以点进`MatState`去看
*/
export
const
matStore
=
proxy
<
MatStore
>
(
new
MatStore
());
// @ts-ignore 挂到全局,便于调试
// @ts-ignore 挂到全局,便于调试
window
.
matStore
=
matStore
;
window
.
matStore
=
matStore
;
src/stores/matStore/types.ts
View file @
d6f16bf0
import
type
{
ygopro
}
from
"
@/api
"
;
import
type
{
ygopro
}
from
"
@/api
"
;
import
{
NeosStore
}
from
"
../shared
"
;
// >>> play mat state >>>
// >>> play mat state >>>
export
interface
BothSide
<
T
>
{
export
interface
BothSide
<
T
>
{
...
@@ -11,7 +9,7 @@ export interface BothSide<T> {
...
@@ -11,7 +9,7 @@ export interface BothSide<T> {
of
:
(
controller
:
number
)
=>
T
;
of
:
(
controller
:
number
)
=>
T
;
}
}
export
interface
MatState
extends
NeosStore
{
export
interface
MatState
{
selfType
:
number
;
selfType
:
number
;
initInfo
:
BothSide
<
InitInfo
>
&
{
initInfo
:
BothSide
<
InitInfo
>
&
{
...
...
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