- commit
- c13377fc21e292a6b9a00f0d199aca288f92d204
- parent
- 248a5f6ebaa58905954ae9098f6813887ecf1c11
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2019-10-31 06:39
support tileLimit in reset
Diffstat
| M | src/index.js | 4 | ++++ |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
@@ -88,6 +88,7 @@ on('click', '.js-play', function(state) {
88 88 if (!state.game.playing) {
89 89 state.game.gameOnPlay.board = clone(state.game.board);
90 90 state.game.gameOnPlay.turnCounter = state.game.turnCounter;
-1 91 state.game.gameOnPlay.tileLimit = state.game.tileLimit;
91 92 }
92 93 state.game.playing = !state.game.playing;
93 94 play();
@@ -99,6 +100,7 @@ on('click', '.js-reset', function(state) {
99 100 }
100 101 state.game.board = clone(state.game.gameOnPlay.board);
101 102 state.game.turnCounter = state.game.gameOnPlay.turnCounter;
-1 103 state.game.tileLimit = state.game.gameOnPlay.tileLimit;
102 104 });
103 105
104 106 on('click', '.js-current-player', function(state) {
@@ -130,6 +132,7 @@ on('click', '.js-menu-sandbox', function(state) {
130 132 sandbox: true,
131 133 gameOnPlay: {
132 134 board: logic.setupBoard(),
-1 135 tileLimit: Infinity,
133 136 turnCounter: 0,
134 137 },
135 138 }
@@ -149,6 +152,7 @@ on('click', '.js-menu-scenario', function(state) {
149 152 turnCounter: 0,
150 153 gameOnPlay: {
151 154 board: clone(scenarios[i].board),
-1 155 tileLimit: scenarios[i].tileLimit || Infinity,
152 156 turnCounter: 0,
153 157 },
154 158 }