labag 2.6.0 → 2.6.2
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.d.ts +2 -1
- package/dist/labag.js +3 -0
- package/package.json +1 -1
- package/src/labag.ts +5 -1
package/dist/labag.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Mode } from "./mode";
|
|
2
|
-
import { Pattern, LaBaGEvent } from "./types";
|
|
2
|
+
import { Pattern, LaBaGEvent, ModeName } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* 拉霸遊戲的主要類別。
|
|
5
5
|
*/
|
|
@@ -94,5 +94,6 @@ export declare class LaBaG {
|
|
|
94
94
|
roundEnd(): void;
|
|
95
95
|
gameOver(): void;
|
|
96
96
|
play(): void;
|
|
97
|
+
getMode(name: ModeName): Mode<Record<string, any>, string> | undefined;
|
|
97
98
|
get isRunning(): boolean;
|
|
98
99
|
}
|
package/dist/labag.js
CHANGED
package/package.json
CHANGED
package/src/labag.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mode } from "./mode";
|
|
2
2
|
import { patterns } from "./pattern";
|
|
3
|
-
import { Pattern, LaBaGEvent, PatternName } from "./types";
|
|
3
|
+
import { Pattern, LaBaGEvent, PatternName, ModeName } from "./types";
|
|
4
4
|
import { randInt } from "./utils/randInt";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -290,6 +290,10 @@ export class LaBaG {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
+
getMode(name: ModeName) {
|
|
294
|
+
return this.modes.find((m) => m.name === name);
|
|
295
|
+
}
|
|
296
|
+
|
|
293
297
|
get isRunning() {
|
|
294
298
|
return this.played < this.times;
|
|
295
299
|
}
|