Skip to content

Commit 8bea508

Browse files
committed
setup editor position & progress state
1 parent a54f1d5 commit 8bea508

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

src/services/state/Position.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as CR from 'typings'
2+
3+
// position
4+
class Position {
5+
private value: CR.Position
6+
constructor() {
7+
this.value = {
8+
levelId: '',
9+
stageId: '',
10+
stepId: '',
11+
}
12+
}
13+
public get = () => {
14+
return this.value
15+
}
16+
public set = (value: CR.Position) => {
17+
this.value = value
18+
}
19+
}
20+
21+
export default Position

src/services/state/Progress.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as CR from 'typings'
2+
3+
// progress
4+
class Progress {
5+
private value: CR.Progress
6+
constructor() {
7+
this.value = {
8+
levels: {},
9+
stages: {},
10+
steps: {},
11+
complete: false
12+
}
13+
}
14+
public get = () => {
15+
return this.value
16+
}
17+
public set = (value: CR.Progress) => {
18+
this.value = value
19+
}
20+
}
21+
22+
export default Progress

src/services/state/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Position from './Position'
2+
import Progress from './Progress'
3+
4+
export const position = new Position()
5+
export const progress = new Progress()

0 commit comments

Comments
 (0)