-
Notifications
You must be signed in to change notification settings - Fork 550
/
mutations.js
77 lines (77 loc) · 1.51 KB
/
mutations.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import { getNextType } from '../unit'
import Block from '../unit/block'
const mutations = {
nextBlock(state, data) {
if (!data) {
data = getNextType()
}
state.next = data
},
moveBlock(state, data) {
state.cur = data.reset === true ? null : new Block(data)
},
speedStart(state, data) {
state.speedStart = data
},
speedRun(state, data) {
state.speedRun = data
},
startLines(state, data) {
state.startLines = data
},
matrix(state, data) {
state.matrix = data
},
lock(state, data) {
state.lock = data
},
clearLines(state, data) {
state.clearLines = data
},
points(state, data) {
state.points = data
},
max(state, data) {
state.max = data
},
reset(state, data) {
state.reset = data
},
drop(state, data) {
state.drop = data
},
pause(state, data) {
state.pause = data
},
music(state, data) {
state.music = data
},
focus(state, data) {
state.focus = data
},
key_drop(state, data) {
state.keyboard['drop'] = data
},
key_down(state, data) {
state.keyboard['down'] = data
},
key_left(state, data) {
state.keyboard['left'] = data
},
key_right(state, data) {
state.keyboard['right'] = data
},
key_rotate(state, data) {
state.keyboard['rotate'] = data
},
key_reset(state, data) {
state.keyboard['reset'] = data
},
key_music(state, data) {
state.keyboard['music'] = data
},
key_pause(state, data) {
state.keyboard['pause'] = data
}
}
export default mutations