Commit 3e698b65 authored by timel's avatar timel

refactor: place store gen

parent 74e504ea
Pipeline #22582 passed with stages
in 9 minutes and 45 seconds
......@@ -20,39 +20,21 @@ export interface BlockState {
disabled: boolean; // 是否被禁用
}
const genPLaces = (n: number): BlockState[] =>
Array.from({ length: n }).map(() => ({
interactivity: undefined,
disabled: false,
}));
export const placeStore = proxy({
inner: {
[MZONE]: {
me: Array.from({ length: 7 }).map(
() =>
({
interactivity: undefined,
disabled: false,
} as BlockState)
),
op: Array.from({ length: 7 }).map(
() =>
({
interactivity: undefined,
disabled: false,
} as BlockState)
),
me: genPLaces(7),
op: genPLaces(7),
},
[SZONE]: {
me: Array.from({ length: 6 }).map(
() =>
({
interactivity: undefined,
disabled: false,
} as BlockState)
),
op: Array.from({ length: 6 }).map(
() =>
({
interactivity: undefined,
disabled: false,
} as BlockState)
),
me: genPLaces(6),
op: genPLaces(6),
},
},
set(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment