labag 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/labag.js +3 -6
- package/dist/mode.js +0 -3
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/labag.ts +3 -6
- package/src/mode.ts +0 -3
package/dist/labag.js
CHANGED
|
@@ -85,8 +85,7 @@ class LaBaG {
|
|
|
85
85
|
getCurrentConfig() {
|
|
86
86
|
const activeModes = this.modes.filter((m) => m.active);
|
|
87
87
|
if (activeModes.length === 0) {
|
|
88
|
-
|
|
89
|
-
return { modes: activeModes, ranges: [] };
|
|
88
|
+
throw new Error("目前沒有啟用中的模式,無法轉動拉霸機。");
|
|
90
89
|
}
|
|
91
90
|
// 合併所有啟用中模式的機率設定
|
|
92
91
|
const combinedRates = {
|
|
@@ -164,8 +163,7 @@ class LaBaG {
|
|
|
164
163
|
calculateScore() {
|
|
165
164
|
const [p1, p2, p3] = this.patterns;
|
|
166
165
|
if (!p1 || !p2 || !p3) {
|
|
167
|
-
|
|
168
|
-
return;
|
|
166
|
+
throw new Error("圖案未正確生成,無法計算分數。");
|
|
169
167
|
}
|
|
170
168
|
if (p1.name === p2.name && p2.name === p3.name) {
|
|
171
169
|
// 三個圖案相同
|
|
@@ -207,8 +205,7 @@ class LaBaG {
|
|
|
207
205
|
}
|
|
208
206
|
play() {
|
|
209
207
|
if (!this.isRunning()) {
|
|
210
|
-
|
|
211
|
-
return;
|
|
208
|
+
throw new Error("遊戲次數已達上限,無法繼續遊玩。");
|
|
212
209
|
}
|
|
213
210
|
this.roundStart();
|
|
214
211
|
this.rollSlots();
|
package/dist/mode.js
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/labag.ts
CHANGED
|
@@ -93,8 +93,7 @@ export class LaBaG {
|
|
|
93
93
|
getCurrentConfig() {
|
|
94
94
|
const activeModes = this.modes.filter((m) => m.active);
|
|
95
95
|
if (activeModes.length === 0) {
|
|
96
|
-
|
|
97
|
-
return { modes: activeModes, ranges: [] };
|
|
96
|
+
throw new Error("目前沒有啟用中的模式,無法轉動拉霸機。");
|
|
98
97
|
}
|
|
99
98
|
// 合併所有啟用中模式的機率設定
|
|
100
99
|
const combinedRates: Record<PatternName, number> = {
|
|
@@ -180,8 +179,7 @@ export class LaBaG {
|
|
|
180
179
|
private calculateScore() {
|
|
181
180
|
const [p1, p2, p3] = this.patterns;
|
|
182
181
|
if (!p1 || !p2 || !p3) {
|
|
183
|
-
|
|
184
|
-
return;
|
|
182
|
+
throw new Error("圖案未正確生成,無法計算分數。");
|
|
185
183
|
}
|
|
186
184
|
if (p1.name === p2.name && p2.name === p3.name) {
|
|
187
185
|
// 三個圖案相同
|
|
@@ -225,8 +223,7 @@ export class LaBaG {
|
|
|
225
223
|
|
|
226
224
|
play() {
|
|
227
225
|
if (!this.isRunning()) {
|
|
228
|
-
|
|
229
|
-
return;
|
|
226
|
+
throw new Error("遊戲次數已達上限,無法繼續遊玩。");
|
|
230
227
|
}
|
|
231
228
|
this.roundStart();
|
|
232
229
|
this.rollSlots();
|