File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,12 @@ const Minefield = {
24
24
// Game instance structure Minefield.getInstance()
25
25
const instance = {
26
26
addListener : (event , fn ) => {},
27
- start : () => {},
28
- open : (x , y ) => {},
29
- flag : (x , y ) => {},
30
- getState : () => {},
31
- reset : () => {}
27
+ start : () => game .start (),
28
+ open : (x , y ) => game .open (x, y),
29
+ flag : (x , y ) => game .flag (x, y),
30
+ batch : (payload ) => game .batch (payload),
31
+ getState : () => game .getState (),
32
+ reset : () => game .start ()
32
33
}
33
34
```
34
35
@@ -57,6 +58,12 @@ minefield.flag(row, cow) // toggle action
57
58
58
59
// Open a checker
59
60
minefield .open (row, cow)
61
+
62
+ // Open or make flag to many checker
63
+ minefield .batck ([
64
+ { row, cow },
65
+ { row, cow, flag: true }
66
+ ])
60
67
```
61
68
62
69
** Options**
You can’t perform that action at this time.
0 commit comments