@gamepark/rules-api 6.17.1 → 6.17.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.
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { MaterialRulesPart } from './MaterialRulesPart';
|
|
2
1
|
import { MaterialMove } from '../moves';
|
|
2
|
+
import { MaterialRulesPart } from './MaterialRulesPart';
|
|
3
3
|
export declare abstract class SimultaneousRule<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> extends MaterialRulesPart<Player, MaterialType, LocationType> {
|
|
4
4
|
isTurnToPlay(player: Player): boolean;
|
|
5
|
+
getLegalMoves(player: Player): MaterialMove<Player, MaterialType, LocationType>[];
|
|
6
|
+
abstract getActivePlayerLegalMoves(playerId: Player): MaterialMove<Player, MaterialType, LocationType>[];
|
|
5
7
|
getAutomaticMoves(): MaterialMove<Player, MaterialType, LocationType>[];
|
|
6
8
|
abstract getMovesAfterPlayersDone(): MaterialMove<Player, MaterialType, LocationType>[];
|
|
7
9
|
}
|
|
@@ -26,6 +26,9 @@ var SimultaneousRule = (function (_super) {
|
|
|
26
26
|
var _a, _b, _c;
|
|
27
27
|
return (_c = (_b = (_a = this.game.rule) === null || _a === void 0 ? void 0 : _a.players) === null || _b === void 0 ? void 0 : _b.includes(player)) !== null && _c !== void 0 ? _c : false;
|
|
28
28
|
};
|
|
29
|
+
SimultaneousRule.prototype.getLegalMoves = function (player) {
|
|
30
|
+
return this.isTurnToPlay(player) ? this.getActivePlayerLegalMoves(player) : [];
|
|
31
|
+
};
|
|
29
32
|
SimultaneousRule.prototype.getAutomaticMoves = function () {
|
|
30
33
|
var _a, _b;
|
|
31
34
|
if (!((_b = (_a = this.game.rule) === null || _a === void 0 ? void 0 : _a.players) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimultaneousRule.js","sourceRoot":"","sources":["../../../src/material/rules/SimultaneousRule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SimultaneousRule.js","sourceRoot":"","sources":["../../../src/material/rules/SimultaneousRule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,yDAAuD;AAEvD;IACU,oCAAqD;IAD/D;;IAqBA,CAAC;IAlBC,uCAAY,GAAZ,UAAa,MAAc;;QACzB,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,IAAI,0CAAE,OAAO,0CAAE,QAAQ,CAAC,MAAM,CAAC,mCAAI,KAAK,CAAA;IAC3D,CAAC;IAED,wCAAa,GAAb,UAAc,MAAc;QAC1B,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAChF,CAAC;IAID,4CAAiB,GAAjB;;QACE,IAAI,CAAC,CAAA,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAA,EAAE;YACpC,OAAO,IAAI,CAAC,wBAAwB,EAAE,CAAA;SACvC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IAGH,uBAAC;AAAD,CAAC,AArBD,CACU,qCAAiB,GAoB1B;AArBqB,4CAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/rules-api",
|
|
3
|
-
"version": "6.17.
|
|
3
|
+
"version": "6.17.2",
|
|
4
4
|
"description": "API to implement the rules of a board game",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"@types/lodash": "^4.14.195",
|
|
30
30
|
"i18next": ">=21.3.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "b182d2d3d974fa61bffce5a7ad09ac5ddb10a704"
|
|
33
33
|
}
|