@gamepark/rules-api 6.18.0 → 6.20.0
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/Action.d.ts +25 -25
- package/dist/Action.js +61 -61
- package/dist/Action.js.map +1 -1
- package/dist/ApplyAutomaticMoves.d.ts +2 -2
- package/dist/ApplyAutomaticMoves.js +24 -24
- package/dist/ApplyAutomaticMoves.js.map +1 -1
- package/dist/Competitive.d.ts +13 -13
- package/dist/Competitive.js +45 -45
- package/dist/Competitive.js.map +1 -1
- package/dist/DefaultGameSetup.d.ts +7 -7
- package/dist/DefaultGameSetup.js +14 -14
- package/dist/Dummy.d.ts +7 -7
- package/dist/Dummy.js +26 -26
- package/dist/Dummy.js.map +1 -1
- package/dist/Eliminations.d.ts +5 -5
- package/dist/Eliminations.js +8 -8
- package/dist/GameSetup.d.ts +3 -3
- package/dist/GameSetup.js +2 -2
- package/dist/GameSetupCreator.d.ts +4 -4
- package/dist/GameSetupCreator.js +2 -2
- package/dist/IncompleteInformation.d.ts +14 -14
- package/dist/IncompleteInformation.js +37 -37
- package/dist/IncompleteInformation.js.map +1 -1
- package/dist/LocalMovePreview.d.ts +4 -0
- package/dist/LocalMovePreview.js +8 -0
- package/dist/LocalMovePreview.js.map +1 -0
- package/dist/LoopWithFuse.d.ts +4 -4
- package/dist/LoopWithFuse.js +14 -14
- package/dist/LoopWithFuse.js.map +1 -1
- package/dist/RandomMove.d.ts +7 -7
- package/dist/RandomMove.js +14 -14
- package/dist/Robot.d.ts +1 -1
- package/dist/Robot.js +2 -2
- package/dist/Rules.d.ts +18 -17
- package/dist/Rules.js +78 -78
- package/dist/Rules.js.map +1 -1
- package/dist/RulesCreator.d.ts +7 -7
- package/dist/RulesCreator.js +2 -2
- package/dist/TimeLimit.d.ts +10 -10
- package/dist/TimeLimit.js +12 -12
- package/dist/TimeLimit.js.map +1 -1
- package/dist/Undo.d.ts +6 -6
- package/dist/Undo.js +8 -8
- package/dist/UnpredictableMove.d.ts +5 -5
- package/dist/UnpredictableMove.js +5 -5
- package/dist/index.d.ts +21 -20
- package/dist/index.js +37 -36
- package/dist/index.js.map +1 -1
- package/dist/material/HiddenMaterialRules.d.ts +36 -35
- package/dist/material/HiddenMaterialRules.js +245 -245
- package/dist/material/HiddenMaterialRules.js.map +1 -1
- package/dist/material/MaterialGame.d.ts +15 -15
- package/dist/material/MaterialGame.js +2 -2
- package/dist/material/MaterialGameSetup.d.ts +21 -21
- package/dist/material/MaterialGameSetup.js +75 -75
- package/dist/material/MaterialGameSetup.js.map +1 -1
- package/dist/material/MaterialRules.d.ts +44 -44
- package/dist/material/MaterialRules.js +242 -242
- package/dist/material/MaterialRules.js.map +1 -1
- package/dist/material/SecretMaterialRules.d.ts +13 -13
- package/dist/material/SecretMaterialRules.js +37 -37
- package/dist/material/index.d.ts +10 -10
- package/dist/material/index.js +26 -26
- package/dist/material/items/Material.d.ts +59 -57
- package/dist/material/items/Material.js +406 -376
- package/dist/material/items/Material.js.map +1 -1
- package/dist/material/items/MaterialItem.d.ts +7 -7
- package/dist/material/items/MaterialItem.js +2 -2
- package/dist/material/items/MaterialMutator.d.ts +31 -31
- package/dist/material/items/MaterialMutator.js +277 -272
- package/dist/material/items/MaterialMutator.js.map +1 -1
- package/dist/material/items/index.d.ts +3 -3
- package/dist/material/items/index.js +19 -19
- package/dist/material/location/Location.d.ts +11 -11
- package/dist/material/location/Location.js +2 -2
- package/dist/material/location/LocationBuilder.d.ts +12 -12
- package/dist/material/location/LocationBuilder.js +40 -40
- package/dist/material/location/index.d.ts +3 -3
- package/dist/material/location/index.js +19 -19
- package/dist/material/location/strategy/FillGapStrategy.d.ts +7 -7
- package/dist/material/location/strategy/FillGapStrategy.js +23 -23
- package/dist/material/location/strategy/FillGapStrategy.js.map +1 -1
- package/dist/material/location/strategy/LocationStrategy.d.ts +6 -6
- package/dist/material/location/strategy/LocationStrategy.js +2 -2
- package/dist/material/location/strategy/PositiveSequenceStrategy.d.ts +9 -9
- package/dist/material/location/strategy/PositiveSequenceStrategy.js +65 -65
- package/dist/material/location/strategy/PositiveSequenceStrategy.js.map +1 -1
- package/dist/material/location/strategy/index.d.ts +3 -3
- package/dist/material/location/strategy/index.js +19 -19
- package/dist/material/memory/GameMemory.d.ts +8 -8
- package/dist/material/memory/GameMemory.js +27 -27
- package/dist/material/memory/GameMemory.js.map +1 -1
- package/dist/material/memory/PlayerMemory.d.ts +9 -9
- package/dist/material/memory/PlayerMemory.js +32 -32
- package/dist/material/memory/PlayerMemory.js.map +1 -1
- package/dist/material/memory/index.d.ts +2 -2
- package/dist/material/memory/index.js +18 -18
- package/dist/material/moves/CustomMove.d.ts +9 -9
- package/dist/material/moves/CustomMove.js +10 -10
- package/dist/material/moves/MaterialMove.d.ts +7 -7
- package/dist/material/moves/MaterialMove.js +2 -2
- package/dist/material/moves/MoveKind.d.ts +6 -6
- package/dist/material/moves/MoveKind.js +10 -10
- package/dist/material/moves/MoveKind.js.map +1 -1
- package/dist/material/moves/index.d.ts +6 -6
- package/dist/material/moves/index.js +22 -22
- package/dist/material/moves/items/CreateItem.d.ts +10 -10
- package/dist/material/moves/items/CreateItem.js +15 -15
- package/dist/material/moves/items/CreateItemsAtOnce.d.ts +10 -10
- package/dist/material/moves/items/CreateItemsAtOnce.js +15 -15
- package/dist/material/moves/items/DeleteItem.d.ts +10 -10
- package/dist/material/moves/items/DeleteItem.js +15 -15
- package/dist/material/moves/items/DeleteItemsAtOnce.d.ts +9 -9
- package/dist/material/moves/items/DeleteItemsAtOnce.js +15 -15
- package/dist/material/moves/items/ItemMove.d.ts +17 -17
- package/dist/material/moves/items/ItemMove.js +2 -2
- package/dist/material/moves/items/ItemMoveType.d.ts +11 -11
- package/dist/material/moves/items/ItemMoveType.js +15 -15
- package/dist/material/moves/items/ItemMoveType.js.map +1 -1
- package/dist/material/moves/items/ItemMovesBuilder.d.ts +8 -8
- package/dist/material/moves/items/ItemMovesBuilder.js +33 -33
- package/dist/material/moves/items/ItemMovesBuilder.js.map +1 -1
- package/dist/material/moves/items/MoveItem.d.ts +14 -14
- package/dist/material/moves/items/MoveItem.js +15 -15
- package/dist/material/moves/items/MoveItemsAtOnce.d.ts +13 -13
- package/dist/material/moves/items/MoveItemsAtOnce.js +15 -15
- package/dist/material/moves/items/RollItem.d.ts +11 -11
- package/dist/material/moves/items/RollItem.js +15 -15
- package/dist/material/moves/items/SelectItem.d.ts +11 -10
- package/dist/material/moves/items/SelectItem.js +15 -15
- package/dist/material/moves/items/SelectItem.js.map +1 -1
- package/dist/material/moves/items/Shuffle.d.ts +13 -13
- package/dist/material/moves/items/Shuffle.js +19 -19
- package/dist/material/moves/items/index.d.ts +12 -12
- package/dist/material/moves/items/index.js +28 -28
- package/dist/material/moves/local/CloseTutorialPopup.d.ts +8 -8
- package/dist/material/moves/local/CloseTutorialPopup.js +9 -9
- package/dist/material/moves/local/DisplayHelp.d.ts +39 -39
- package/dist/material/moves/local/DisplayHelp.js +29 -29
- package/dist/material/moves/local/DisplayHelp.js.map +1 -1
- package/dist/material/moves/local/DropItem.d.ts +13 -13
- package/dist/material/moves/local/DropItem.js +9 -9
- package/dist/material/moves/local/LocalMove.d.ts +12 -12
- package/dist/material/moves/local/LocalMove.js +11 -11
- package/dist/material/moves/local/LocalMove.js.map +1 -1
- package/dist/material/moves/local/SetTutorialStep.d.ts +9 -9
- package/dist/material/moves/local/SetTutorialStep.js +9 -9
- package/dist/material/moves/local/index.d.ts +5 -5
- package/dist/material/moves/local/index.js +21 -21
- package/dist/material/moves/rules/EndGame.d.ts +6 -6
- package/dist/material/moves/rules/EndGame.js +9 -9
- package/dist/material/moves/rules/EndPlayerTurn.d.ts +7 -7
- package/dist/material/moves/rules/EndPlayerTurn.js +9 -9
- package/dist/material/moves/rules/RuleMove.d.ts +18 -18
- package/dist/material/moves/rules/RuleMove.js +18 -18
- package/dist/material/moves/rules/RuleMove.js.map +1 -1
- package/dist/material/moves/rules/StartPlayerTurn.d.ts +8 -8
- package/dist/material/moves/rules/StartPlayerTurn.js +9 -9
- package/dist/material/moves/rules/StartRule.d.ts +7 -7
- package/dist/material/moves/rules/StartRule.js +9 -9
- package/dist/material/moves/rules/StartSimultaneousRule.d.ts +8 -8
- package/dist/material/moves/rules/StartSimultaneousRule.js +9 -9
- package/dist/material/moves/rules/index.d.ts +6 -6
- package/dist/material/moves/rules/index.js +22 -22
- package/dist/material/rules/MaterialRulesMovesBuilder.d.ts +12 -12
- package/dist/material/rules/MaterialRulesMovesBuilder.js +35 -35
- package/dist/material/rules/MaterialRulesPart.d.ts +23 -23
- package/dist/material/rules/MaterialRulesPart.js +64 -64
- package/dist/material/rules/MaterialRulesPart.js.map +1 -1
- package/dist/material/rules/PlayerTurnRule.d.ts +9 -9
- package/dist/material/rules/PlayerTurnRule.js +52 -52
- package/dist/material/rules/RuleStep.d.ts +5 -5
- package/dist/material/rules/RuleStep.js +2 -2
- package/dist/material/rules/SimultaneousRule.d.ts +9 -9
- package/dist/material/rules/SimultaneousRule.js +41 -41
- package/dist/material/rules/SimultaneousRule.js.map +1 -1
- package/dist/material/rules/index.d.ts +5 -5
- package/dist/material/rules/index.js +21 -21
- package/dist/options/EnumOption.d.ts +6 -6
- package/dist/options/EnumOption.js +7 -7
- package/dist/options/Option.d.ts +8 -8
- package/dist/options/Option.js +2 -2
- package/dist/options/OptionSpecOf.d.ts +5 -5
- package/dist/options/OptionSpecOf.js +2 -2
- package/dist/options/OptionsSpec.d.ts +9 -9
- package/dist/options/OptionsSpec.js +2 -2
- package/dist/options/OptionsValidationError.d.ts +4 -4
- package/dist/options/OptionsValidationError.js +29 -29
- package/dist/options/OptionsValidationError.js.map +1 -1
- package/dist/options/PlayerEnumOption.d.ts +14 -14
- package/dist/options/PlayerEnumOption.js +66 -66
- package/dist/options/PlayerEnumOption.js.map +1 -1
- package/dist/options/PlayersOptionsSpec.d.ts +7 -7
- package/dist/options/PlayersOptionsSpec.js +2 -2
- package/dist/options/WithIdOption.d.ts +3 -3
- package/dist/options/WithIdOption.js +2 -2
- package/dist/options/WithPlayerOptionsSpec.d.ts +6 -6
- package/dist/options/WithPlayerOptionsSpec.js +7 -7
- package/dist/options/WithPlayersOptions.d.ts +3 -3
- package/dist/options/WithPlayersOptions.js +2 -2
- package/dist/options/index.d.ts +11 -11
- package/dist/options/index.js +27 -27
- package/dist/options/isWithPlayerIdOptions.d.ts +4 -4
- package/dist/options/isWithPlayerIdOptions.js +11 -11
- package/dist/utils/EnumUtils.d.ts +1 -1
- package/dist/utils/EnumUtils.js +7 -7
- package/dist/utils/grid.squares.util.d.ts +11 -11
- package/dist/utils/grid.squares.util.js +30 -30
- package/dist/utils/grid.squares.util.js.map +1 -1
- package/dist/utils/grid.util.d.ts +5 -5
- package/dist/utils/grid.util.js +7 -7
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.js +21 -21
- package/dist/utils/isDeadEndMove.util.d.ts +2 -2
- package/dist/utils/isDeadEndMove.util.js +18 -18
- package/dist/utils/listing.util.d.ts +2 -2
- package/dist/utils/listing.util.js +23 -23
- package/dist/utils/listing.util.js.map +1 -1
- package/package.json +34 -33
- package/dist/material/items/MaterialDeck.d.ts +0 -7
- package/dist/material/items/MaterialDeck.js +0 -35
- package/dist/material/items/MaterialDeck.js.map +0 -1
- package/dist/material/moves/items/MoveAtOnce.d.ts +0 -13
- package/dist/material/moves/items/MoveAtOnce.js +0 -16
- package/dist/material/moves/items/MoveAtOnce.js.map +0 -1
- package/dist/material/moves/items/Roll.d.ts +0 -11
- package/dist/material/moves/items/Roll.js +0 -16
- package/dist/material/moves/items/Roll.js.map +0 -1
- package/dist/material/moves/local/DisplayRules.d.ts +0 -32
- package/dist/material/moves/local/DisplayRules.js +0 -25
- package/dist/material/moves/local/DisplayRules.js.map +0 -1
- package/dist/material/moves/rules/StartSimultanousRule.d.ts +0 -10
- package/dist/material/moves/rules/StartSimultanousRule.js +0 -10
- package/dist/material/moves/rules/StartSimultanousRule.js.map +0 -1
- package/dist/options/PlayerIdSpec.d.ts +0 -7
- package/dist/options/PlayerIdSpec.js +0 -18
- package/dist/options/PlayerIdSpec.js.map +0 -1
- package/dist/options/getFallbackPlayerName.d.ts +0 -4
- package/dist/options/getFallbackPlayerName.js +0 -14
- package/dist/options/getFallbackPlayerName.js.map +0 -1
- package/dist/options/providePlayerIds.d.ts +0 -6
- package/dist/options/providePlayerIds.js +0 -36
- package/dist/options/providePlayerIds.js.map +0 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSquareInDirection = exports.directions = exports.Direction = exports.getDistanceBetweenSquares = exports.areAdjacentSquares = void 0;
|
|
4
|
-
var EnumUtils_1 = require("./EnumUtils");
|
|
5
|
-
var grid_util_1 = require("./grid.util");
|
|
6
|
-
var areAdjacentSquares = function (square1, square2) {
|
|
7
|
-
return (0, grid_util_1.isXYCoordinates)(square1) && (0, grid_util_1.isXYCoordinates)(square2) && (0, exports.getDistanceBetweenSquares)(square1, square2) === 1;
|
|
8
|
-
};
|
|
9
|
-
exports.areAdjacentSquares = areAdjacentSquares;
|
|
10
|
-
var getDistanceBetweenSquares = function (square1, square2) {
|
|
11
|
-
return Math.abs(square1.x - square2.x) + Math.abs(square1.y - square2.y);
|
|
12
|
-
};
|
|
13
|
-
exports.getDistanceBetweenSquares = getDistanceBetweenSquares;
|
|
14
|
-
var Direction;
|
|
15
|
-
(function (Direction) {
|
|
16
|
-
Direction[Direction["North"] = 1] = "North";
|
|
17
|
-
Direction[Direction["South"] = 2] = "South";
|
|
18
|
-
Direction[Direction["East"] = 3] = "East";
|
|
19
|
-
Direction[Direction["West"] = 4] = "West";
|
|
20
|
-
})(Direction
|
|
21
|
-
exports.directions = Object.values(Direction).filter(EnumUtils_1.isEnumValue);
|
|
22
|
-
var getSquareInDirection = function (origin, direction) {
|
|
23
|
-
if (origin.x === undefined || origin.y === undefined)
|
|
24
|
-
throw new Error('Missing x or y to getSquareInDirection');
|
|
25
|
-
return {
|
|
26
|
-
x: direction === Direction.East ? origin.x - 1 : direction === Direction.West ? origin.x + 1 : origin.x,
|
|
27
|
-
y: direction === Direction.North ? origin.y - 1 : direction === Direction.South ? origin.y + 1 : origin.y
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
exports.getSquareInDirection = getSquareInDirection;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSquareInDirection = exports.directions = exports.Direction = exports.getDistanceBetweenSquares = exports.areAdjacentSquares = void 0;
|
|
4
|
+
var EnumUtils_1 = require("./EnumUtils");
|
|
5
|
+
var grid_util_1 = require("./grid.util");
|
|
6
|
+
var areAdjacentSquares = function (square1, square2) {
|
|
7
|
+
return (0, grid_util_1.isXYCoordinates)(square1) && (0, grid_util_1.isXYCoordinates)(square2) && (0, exports.getDistanceBetweenSquares)(square1, square2) === 1;
|
|
8
|
+
};
|
|
9
|
+
exports.areAdjacentSquares = areAdjacentSquares;
|
|
10
|
+
var getDistanceBetweenSquares = function (square1, square2) {
|
|
11
|
+
return Math.abs(square1.x - square2.x) + Math.abs(square1.y - square2.y);
|
|
12
|
+
};
|
|
13
|
+
exports.getDistanceBetweenSquares = getDistanceBetweenSquares;
|
|
14
|
+
var Direction;
|
|
15
|
+
(function (Direction) {
|
|
16
|
+
Direction[Direction["North"] = 1] = "North";
|
|
17
|
+
Direction[Direction["South"] = 2] = "South";
|
|
18
|
+
Direction[Direction["East"] = 3] = "East";
|
|
19
|
+
Direction[Direction["West"] = 4] = "West";
|
|
20
|
+
})(Direction || (exports.Direction = Direction = {}));
|
|
21
|
+
exports.directions = Object.values(Direction).filter(EnumUtils_1.isEnumValue);
|
|
22
|
+
var getSquareInDirection = function (origin, direction) {
|
|
23
|
+
if (origin.x === undefined || origin.y === undefined)
|
|
24
|
+
throw new Error('Missing x or y to getSquareInDirection');
|
|
25
|
+
return {
|
|
26
|
+
x: direction === Direction.East ? origin.x - 1 : direction === Direction.West ? origin.x + 1 : origin.x,
|
|
27
|
+
y: direction === Direction.North ? origin.y - 1 : direction === Direction.South ? origin.y + 1 : origin.y
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exports.getSquareInDirection = getSquareInDirection;
|
|
31
31
|
//# sourceMappingURL=grid.squares.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.squares.util.js","sourceRoot":"","sources":["../../src/utils/grid.squares.util.ts"],"names":[],"mappings":";;;AAAA,yCAAyC;AACzC,yCAA4D;AAErD,IAAM,kBAAkB,GAAG,UAAC,OAA+B,EAAE,OAA+B;IACjG,OAAA,IAAA,2BAAe,EAAC,OAAO,CAAC,IAAI,IAAA,2BAAe,EAAC,OAAO,CAAC,IAAI,IAAA,iCAAyB,EAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;AAAzG,CAAyG,CAAA;AAD9F,QAAA,kBAAkB,sBAC4E;AAEpG,IAAM,yBAAyB,GAAG,UAAC,OAAsB,EAAE,OAAsB;IACtF,OAAA,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;AAAjE,CAAiE,CAAA;AADtD,QAAA,yBAAyB,6BAC6B;AAEnE,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,2CAAS,CAAA;IAAE,2CAAK,CAAA;IAAE,yCAAI,CAAA;IAAE,yCAAI,CAAA;AAC9B,CAAC,EAFW,SAAS,
|
|
1
|
+
{"version":3,"file":"grid.squares.util.js","sourceRoot":"","sources":["../../src/utils/grid.squares.util.ts"],"names":[],"mappings":";;;AAAA,yCAAyC;AACzC,yCAA4D;AAErD,IAAM,kBAAkB,GAAG,UAAC,OAA+B,EAAE,OAA+B;IACjG,OAAA,IAAA,2BAAe,EAAC,OAAO,CAAC,IAAI,IAAA,2BAAe,EAAC,OAAO,CAAC,IAAI,IAAA,iCAAyB,EAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;AAAzG,CAAyG,CAAA;AAD9F,QAAA,kBAAkB,sBAC4E;AAEpG,IAAM,yBAAyB,GAAG,UAAC,OAAsB,EAAE,OAAsB;IACtF,OAAA,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;AAAjE,CAAiE,CAAA;AADtD,QAAA,yBAAyB,6BAC6B;AAEnE,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,2CAAS,CAAA;IAAE,2CAAK,CAAA;IAAE,yCAAI,CAAA;IAAE,yCAAI,CAAA;AAC9B,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,uBAAW,CAAC,CAAA;AAE/D,IAAM,oBAAoB,GAAG,UAAC,MAA8B,EAAE,SAAoB;IACvF,IAAI,MAAM,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;IAC/G,OAAO;QACL,CAAC,EAAE,SAAS,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACvG,CAAC,EAAE,SAAS,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;KAC1G,CAAA;AACH,CAAC,CAAA;AANY,QAAA,oBAAoB,wBAMhC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type XYCoordinates = {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
};
|
|
5
|
-
export declare const isXYCoordinates: (coordinates: any) => coordinates is XYCoordinates;
|
|
1
|
+
export type XYCoordinates = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const isXYCoordinates: (coordinates: any) => coordinates is XYCoordinates;
|
package/dist/utils/grid.util.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isXYCoordinates = void 0;
|
|
4
|
-
var isXYCoordinates = function (coordinates) {
|
|
5
|
-
return typeof coordinates === 'object' && typeof coordinates.x === 'number' && typeof coordinates.y === 'number';
|
|
6
|
-
};
|
|
7
|
-
exports.isXYCoordinates = isXYCoordinates;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isXYCoordinates = void 0;
|
|
4
|
+
var isXYCoordinates = function (coordinates) {
|
|
5
|
+
return typeof coordinates === 'object' && typeof coordinates.x === 'number' && typeof coordinates.y === 'number';
|
|
6
|
+
};
|
|
7
|
+
exports.isXYCoordinates = isXYCoordinates;
|
|
8
8
|
//# sourceMappingURL=grid.util.js.map
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './EnumUtils';
|
|
2
|
-
export * from './grid.util';
|
|
3
|
-
export * from './grid.squares.util';
|
|
4
|
-
export * from './isDeadEndMove.util';
|
|
5
|
-
export * from './listing.util';
|
|
1
|
+
export * from './EnumUtils';
|
|
2
|
+
export * from './grid.util';
|
|
3
|
+
export * from './grid.squares.util';
|
|
4
|
+
export * from './isDeadEndMove.util';
|
|
5
|
+
export * from './listing.util';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./EnumUtils"), exports);
|
|
18
|
-
__exportStar(require("./grid.util"), exports);
|
|
19
|
-
__exportStar(require("./grid.squares.util"), exports);
|
|
20
|
-
__exportStar(require("./isDeadEndMove.util"), exports);
|
|
21
|
-
__exportStar(require("./listing.util"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./EnumUtils"), exports);
|
|
18
|
+
__exportStar(require("./grid.util"), exports);
|
|
19
|
+
__exportStar(require("./grid.squares.util"), exports);
|
|
20
|
+
__exportStar(require("./isDeadEndMove.util"), exports);
|
|
21
|
+
__exportStar(require("./listing.util"), exports);
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RulesCreator } from '../RulesCreator';
|
|
2
|
-
export declare function isDeadEndMove<G, M, P>(move: M, game: G, Rules: RulesCreator<G, M, P>, predicate: (game: G) => boolean, maxDepth?: number): boolean;
|
|
1
|
+
import { RulesCreator } from '../RulesCreator';
|
|
2
|
+
export declare function isDeadEndMove<G, M, P>(move: M, game: G, Rules: RulesCreator<G, M, P>, predicate: (game: G) => boolean, maxDepth?: number): boolean;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDeadEndMove = void 0;
|
|
4
|
-
var Action_1 = require("../Action");
|
|
5
|
-
function isDeadEndMove(move, game, Rules, predicate, maxDepth) {
|
|
6
|
-
if (maxDepth === void 0) { maxDepth = 5; }
|
|
7
|
-
if (maxDepth === 0)
|
|
8
|
-
return false;
|
|
9
|
-
var rules = new Rules(JSON.parse(JSON.stringify(game)));
|
|
10
|
-
(0, Action_1.playMove)(rules, move);
|
|
11
|
-
if (predicate(rules.game))
|
|
12
|
-
return false;
|
|
13
|
-
var activePlayer = rules.getActivePlayer();
|
|
14
|
-
if (!activePlayer)
|
|
15
|
-
return true;
|
|
16
|
-
return rules.getLegalMoves(activePlayer).every(function (move) { return isDeadEndMove(move, rules.game, Rules, predicate, maxDepth - 1); });
|
|
17
|
-
}
|
|
18
|
-
exports.isDeadEndMove = isDeadEndMove;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDeadEndMove = void 0;
|
|
4
|
+
var Action_1 = require("../Action");
|
|
5
|
+
function isDeadEndMove(move, game, Rules, predicate, maxDepth) {
|
|
6
|
+
if (maxDepth === void 0) { maxDepth = 5; }
|
|
7
|
+
if (maxDepth === 0)
|
|
8
|
+
return false;
|
|
9
|
+
var rules = new Rules(JSON.parse(JSON.stringify(game)));
|
|
10
|
+
(0, Action_1.playMove)(rules, move);
|
|
11
|
+
if (predicate(rules.game))
|
|
12
|
+
return false;
|
|
13
|
+
var activePlayer = rules.getActivePlayer();
|
|
14
|
+
if (!activePlayer)
|
|
15
|
+
return true;
|
|
16
|
+
return rules.getLegalMoves(activePlayer).every(function (move) { return isDeadEndMove(move, rules.game, Rules, predicate, maxDepth - 1); });
|
|
17
|
+
}
|
|
18
|
+
exports.isDeadEndMove = isDeadEndMove;
|
|
19
19
|
//# sourceMappingURL=isDeadEndMove.util.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function listingToList<T extends number>(listing: Partial<Record<T, number>>): T[];
|
|
2
|
-
export declare function listToListing<T extends number>(list: T[]): Partial<Record<T, number>>;
|
|
1
|
+
export declare function listingToList<T extends number>(listing: Partial<Record<T, number>>): T[];
|
|
2
|
+
export declare function listToListing<T extends number>(list: T[]): Partial<Record<T, number>>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listToListing = exports.listingToList = void 0;
|
|
4
|
-
function listingToList(listing) {
|
|
5
|
-
var list = [];
|
|
6
|
-
for (var key in listing) {
|
|
7
|
-
var intKey = parseInt(key);
|
|
8
|
-
for (var i = 0; i < listing[key]; i++) {
|
|
9
|
-
list.push(intKey);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return list;
|
|
13
|
-
}
|
|
14
|
-
exports.listingToList = listingToList;
|
|
15
|
-
function listToListing(list) {
|
|
16
|
-
var listing = [];
|
|
17
|
-
for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
|
|
18
|
-
var t = list_1[_i];
|
|
19
|
-
t in listing ? listing[t]++ : listing[t] = 1;
|
|
20
|
-
}
|
|
21
|
-
return listing;
|
|
22
|
-
}
|
|
23
|
-
exports.listToListing = listToListing;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listToListing = exports.listingToList = void 0;
|
|
4
|
+
function listingToList(listing) {
|
|
5
|
+
var list = [];
|
|
6
|
+
for (var key in listing) {
|
|
7
|
+
var intKey = parseInt(key);
|
|
8
|
+
for (var i = 0; i < listing[key]; i++) {
|
|
9
|
+
list.push(intKey);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return list;
|
|
13
|
+
}
|
|
14
|
+
exports.listingToList = listingToList;
|
|
15
|
+
function listToListing(list) {
|
|
16
|
+
var listing = [];
|
|
17
|
+
for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
|
|
18
|
+
var t = list_1[_i];
|
|
19
|
+
t in listing ? listing[t]++ : listing[t] = 1;
|
|
20
|
+
}
|
|
21
|
+
return listing;
|
|
22
|
+
}
|
|
23
|
+
exports.listToListing = listToListing;
|
|
24
24
|
//# sourceMappingURL=listing.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listing.util.js","sourceRoot":"","sources":["../../src/utils/listing.util.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAmB,OAAmC;IACjF,IAAM,IAAI,GAAQ,EAAE,CAAA;IACpB,KAAK,IAAM,GAAG,IAAI,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"listing.util.js","sourceRoot":"","sources":["../../src/utils/listing.util.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAmB,OAAmC;IACjF,IAAM,IAAI,GAAQ,EAAE,CAAA;IACpB,KAAK,IAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,IAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAM,CAAA;QACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAE,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AATD,sCASC;AAED,SAAgB,aAAa,CAAmB,IAAS;IACvD,IAAM,OAAO,GAA+B,EAAE,CAAA;IAC9C,KAAgB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE,CAAC;QAAlB,IAAM,CAAC,aAAA;QACV,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAC/C,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAND,sCAMC"}
|
package/package.json
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@gamepark/rules-api",
|
|
3
|
-
"version": "6.
|
|
4
|
-
"description": "API to implement the rules of a board game",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsc -p tsconfig.
|
|
12
|
-
"prepublishOnly": "tsc -p tsconfig.
|
|
13
|
-
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"Game Park",
|
|
16
|
-
"Board games",
|
|
17
|
-
"Rules"
|
|
18
|
-
],
|
|
19
|
-
"author": "Romain Fromi <romain@game-park.com> (https://game-park.com/)",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"fast-deep-equal": "^3.1.3",
|
|
23
|
-
"lodash": "^4.17.21"
|
|
24
|
-
},
|
|
25
|
-
"publishConfig": {
|
|
26
|
-
"access": "public"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@types/lodash": "^4.
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@gamepark/rules-api",
|
|
3
|
+
"version": "6.20.0",
|
|
4
|
+
"description": "API to implement the rules of a board game",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -p tsconfig.json",
|
|
12
|
+
"prepublishOnly": "tsc -p tsconfig.json"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"Game Park",
|
|
16
|
+
"Board games",
|
|
17
|
+
"Rules"
|
|
18
|
+
],
|
|
19
|
+
"author": "Romain Fromi <romain@game-park.com> (https://game-park.com/)",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"fast-deep-equal": "^3.1.3",
|
|
23
|
+
"lodash": "^4.17.21"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/lodash": "^4.17.5",
|
|
30
|
+
"@types/node": "^20.14.2",
|
|
31
|
+
"i18next": ">=21.3.0",
|
|
32
|
+
"typescript": "^5.4.5"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MoveItem } from '../moves';
|
|
2
|
-
import { Material } from './Material';
|
|
3
|
-
import { ItemPosition, MaterialItem } from './MaterialItem';
|
|
4
|
-
export declare class MaterialDeck<P extends number = number, M extends number = number, L extends number = number> extends Material<P, M, L> {
|
|
5
|
-
deal(arg: ((item: MaterialItem<P, L>) => Partial<ItemPosition<P, L>>) | Partial<ItemPosition<P, L>>, quantity?: number): MoveItem<P, M, L>[];
|
|
6
|
-
dealOne(arg: ((item: MaterialItem<P, L>) => Partial<ItemPosition<P, L>>) | Partial<ItemPosition<P, L>>): MoveItem<P, M, L>;
|
|
7
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.MaterialDeck = void 0;
|
|
19
|
-
var Material_1 = require("./Material");
|
|
20
|
-
var MaterialDeck = (function (_super) {
|
|
21
|
-
__extends(MaterialDeck, _super);
|
|
22
|
-
function MaterialDeck() {
|
|
23
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
-
}
|
|
25
|
-
MaterialDeck.prototype.deal = function (arg, quantity) {
|
|
26
|
-
if (quantity === void 0) { quantity = 1; }
|
|
27
|
-
return this.new(this.entries.splice(0, quantity)).moveItems(arg);
|
|
28
|
-
};
|
|
29
|
-
MaterialDeck.prototype.dealOne = function (arg) {
|
|
30
|
-
return this.deal(arg)[0];
|
|
31
|
-
};
|
|
32
|
-
return MaterialDeck;
|
|
33
|
-
}(Material_1.Material));
|
|
34
|
-
exports.MaterialDeck = MaterialDeck;
|
|
35
|
-
//# sourceMappingURL=MaterialDeck.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialDeck.js","sourceRoot":"","sources":["../../../src/material/items/MaterialDeck.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAAqC;AAGrC;IAAmH,gCAAiB;IAApI;;IAQA,CAAC;IAPC,2BAAI,GAAJ,UAAK,GAA8F,EAAE,QAAoB;QAApB,yBAAA,EAAA,YAAoB;QACvH,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAClE,CAAC;IAED,8BAAO,GAAP,UAAQ,GAA8F;QACpG,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1B,CAAC;IACH,mBAAC;AAAD,CAAC,AARD,CAAmH,mBAAQ,GAQ1H;AARY,oCAAY"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MaterialItem } from '../../items';
|
|
2
|
-
import { Location } from '../../location';
|
|
3
|
-
import { MaterialMove } from '../MaterialMove';
|
|
4
|
-
import { MaterialMoveCommon } from './ItemMove';
|
|
5
|
-
import { ItemMoveType } from './ItemMoveType';
|
|
6
|
-
export type MoveAtOnce<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = MaterialMoveCommon<MaterialType> & {
|
|
7
|
-
type: typeof ItemMoveType.MoveAtOnce;
|
|
8
|
-
indexes: number[];
|
|
9
|
-
location: Partial<Location<Player, LocationType>>;
|
|
10
|
-
reveal?: Record<number, Omit<MaterialItem<Player, LocationType>, 'location'>>;
|
|
11
|
-
};
|
|
12
|
-
export declare function isMoveAtOnce<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is MoveAtOnce<P, M, L>;
|
|
13
|
-
export declare function isMoveAtOnceType<P extends number, M extends number, L extends number>(type: M, index?: number): (move: MaterialMove<P, M, L>) => move is MoveAtOnce<P, M, L>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMoveAtOnceType = exports.isMoveAtOnce = void 0;
|
|
4
|
-
var MoveKind_1 = require("../MoveKind");
|
|
5
|
-
var ItemMoveType_1 = require("./ItemMoveType");
|
|
6
|
-
function isMoveAtOnce(move) {
|
|
7
|
-
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.MoveAtOnce;
|
|
8
|
-
}
|
|
9
|
-
exports.isMoveAtOnce = isMoveAtOnce;
|
|
10
|
-
function isMoveAtOnceType(type, index) {
|
|
11
|
-
return function (move) {
|
|
12
|
-
return isMoveAtOnce(move) && move.itemType === type && (index === undefined || move.indexes.includes(index));
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
exports.isMoveAtOnceType = isMoveAtOnceType;
|
|
16
|
-
//# sourceMappingURL=MoveAtOnce.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MoveAtOnce.js","sourceRoot":"","sources":["../../../../src/material/moves/items/MoveAtOnce.ts"],"names":[],"mappings":";;;AAGA,wCAAsC;AAEtC,+CAA6C;AAU7C,SAAgB,YAAY,CAAuD,IAA2B;IAC5G,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,UAAU,CAAA;AACjF,CAAC;AAFD,oCAEC;AAED,SAAgB,gBAAgB,CAC9B,IAAO,EAAE,KAAc;IAEvB,OAAO,UAAC,IAA2B;QACjC,OAAA,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAArG,CAAqG,CAAA;AACzG,CAAC;AALD,4CAKC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Location } from '../../location';
|
|
2
|
-
import { MaterialMove } from '../MaterialMove';
|
|
3
|
-
import { MaterialMoveCommon } from './ItemMove';
|
|
4
|
-
import { ItemMoveType } from './ItemMoveType';
|
|
5
|
-
export type Roll<P extends number = number, M extends number = number, L extends number = number> = MaterialMoveCommon<M> & {
|
|
6
|
-
type: typeof ItemMoveType.Roll;
|
|
7
|
-
itemIndex: number;
|
|
8
|
-
location: Location<P, L>;
|
|
9
|
-
};
|
|
10
|
-
export declare function isRoll<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is Roll<P, M, L>;
|
|
11
|
-
export declare function isRollItemType<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is Roll<P, M, L>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRollItemType = exports.isRoll = void 0;
|
|
4
|
-
var MoveKind_1 = require("../MoveKind");
|
|
5
|
-
var ItemMoveType_1 = require("./ItemMoveType");
|
|
6
|
-
function isRoll(move) {
|
|
7
|
-
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Roll;
|
|
8
|
-
}
|
|
9
|
-
exports.isRoll = isRoll;
|
|
10
|
-
function isRollItemType(type) {
|
|
11
|
-
return function (move) {
|
|
12
|
-
return isRoll(move) && move.itemType === type;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
exports.isRollItemType = isRollItemType;
|
|
16
|
-
//# sourceMappingURL=Roll.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Roll.js","sourceRoot":"","sources":["../../../../src/material/moves/items/Roll.ts"],"names":[],"mappings":";;;AAEA,wCAAsC;AAEtC,+CAA6C;AAQ7C,SAAgB,MAAM,CAAuD,IAA2B;IACtG,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,IAAI,CAAA;AAC3E,CAAC;AAFD,wBAEC;AAED,SAAgB,cAAc,CAC5B,IAAO;IAEP,OAAO,UAAC,IAA2B;QACjC,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;IAAtC,CAAsC,CAAA;AAC1C,CAAC;AALD,wCAKC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { LocalMoveType } from './LocalMove';
|
|
2
|
-
import { MoveKind } from '../MoveKind';
|
|
3
|
-
import { MaterialItem } from '../../items';
|
|
4
|
-
import { Location } from '../../location';
|
|
5
|
-
export type RulesDisplay<P extends number = number, M extends number = number, L extends number = number> = MaterialRulesDisplay<P, M, L> | LocationRulesDisplay<P, L>;
|
|
6
|
-
export declare enum RulesDisplayType {
|
|
7
|
-
Material = 1,
|
|
8
|
-
Location = 2
|
|
9
|
-
}
|
|
10
|
-
export type MaterialRulesDisplay<P extends number = number, M extends number = number, L extends number = number> = {
|
|
11
|
-
type: typeof RulesDisplayType.Material;
|
|
12
|
-
itemType: M;
|
|
13
|
-
itemIndex?: number;
|
|
14
|
-
item: Partial<MaterialItem<P, L>>;
|
|
15
|
-
};
|
|
16
|
-
export type LocationRulesDisplay<P extends number = number, L extends number = number> = {
|
|
17
|
-
type: typeof RulesDisplayType.Location;
|
|
18
|
-
location: Location<P, L>;
|
|
19
|
-
};
|
|
20
|
-
export type DisplayRules<P extends number = number, M extends number = number, L extends number = number> = {
|
|
21
|
-
kind: MoveKind.LocalMove;
|
|
22
|
-
type: typeof LocalMoveType.DisplayRules;
|
|
23
|
-
rulesDisplay: RulesDisplay<P, M, L>;
|
|
24
|
-
};
|
|
25
|
-
export declare const displayRules: <P extends number = number, M extends number = number, L extends number = number>(rulesDisplay: RulesDisplay<P, M, L>) => DisplayRules<P, M, L>;
|
|
26
|
-
export declare const displayMaterialRules: <P extends number = number, M extends number = number, L extends number = number>(itemType: M, item?: Partial<MaterialItem<P, L, any>>, itemIndex?: number) => DisplayRules<P, M, L>;
|
|
27
|
-
export declare const displayLocationRules: <P extends number = number, M extends number = number, L extends number = number>(location: Location<P, L, any, any>) => DisplayRules<P, M, L>;
|
|
28
|
-
export type CloseRulesDisplay = {
|
|
29
|
-
kind: MoveKind.LocalMove;
|
|
30
|
-
type: typeof LocalMoveType.CloseRulesDisplay;
|
|
31
|
-
};
|
|
32
|
-
export declare const closeRulesDisplay: CloseRulesDisplay;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.closeRulesDisplay = exports.displayLocationRules = exports.displayMaterialRules = exports.displayRules = exports.RulesDisplayType = void 0;
|
|
4
|
-
var LocalMove_1 = require("./LocalMove");
|
|
5
|
-
var MoveKind_1 = require("../MoveKind");
|
|
6
|
-
var RulesDisplayType;
|
|
7
|
-
(function (RulesDisplayType) {
|
|
8
|
-
RulesDisplayType[RulesDisplayType["Material"] = 1] = "Material";
|
|
9
|
-
RulesDisplayType[RulesDisplayType["Location"] = 2] = "Location";
|
|
10
|
-
})(RulesDisplayType = exports.RulesDisplayType || (exports.RulesDisplayType = {}));
|
|
11
|
-
var displayRules = function (rulesDisplay) {
|
|
12
|
-
return ({ kind: MoveKind_1.MoveKind.LocalMove, type: LocalMove_1.LocalMoveType.DisplayRules, rulesDisplay: rulesDisplay });
|
|
13
|
-
};
|
|
14
|
-
exports.displayRules = displayRules;
|
|
15
|
-
var displayMaterialRules = function (itemType, item, itemIndex) {
|
|
16
|
-
if (item === void 0) { item = {}; }
|
|
17
|
-
return (0, exports.displayRules)({ type: RulesDisplayType.Material, itemType: itemType, itemIndex: itemIndex, item: item });
|
|
18
|
-
};
|
|
19
|
-
exports.displayMaterialRules = displayMaterialRules;
|
|
20
|
-
var displayLocationRules = function (location) {
|
|
21
|
-
return (0, exports.displayRules)({ type: RulesDisplayType.Location, location: location });
|
|
22
|
-
};
|
|
23
|
-
exports.displayLocationRules = displayLocationRules;
|
|
24
|
-
exports.closeRulesDisplay = { kind: MoveKind_1.MoveKind.LocalMove, type: LocalMove_1.LocalMoveType.CloseRulesDisplay };
|
|
25
|
-
//# sourceMappingURL=DisplayRules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayRules.js","sourceRoot":"","sources":["../../../../src/material/moves/local/DisplayRules.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,wCAAsC;AAQtC,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,+DAAY,CAAA;IAAE,+DAAQ,CAAA;AACxB,CAAC,EAFW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAE3B;AAoBM,IAAM,YAAY,GAAG,UAC3B,YAAmC;IAClC,OAAA,CAAC,EAAE,IAAI,EAAE,mBAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,yBAAa,CAAC,YAAY,EAAE,YAAY,cAAA,EAAE,CAAC;AAA9E,CAA8E,CAAA;AAFnE,QAAA,YAAY,gBAEuD;AAEzE,IAAM,oBAAoB,GAAG,UACnC,QAAW,EAAE,IAAsC,EAAE,SAAkB;IAA1D,qBAAA,EAAA,SAAsC;IAClD,OAAA,IAAA,oBAAY,EAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,UAAA,EAAE,SAAS,WAAA,EAAE,IAAI,MAAA,EAAE,CAAC;AAA5E,CAA4E,CAAA;AAFjE,QAAA,oBAAoB,wBAE6C;AAEvE,IAAM,oBAAoB,GAAG,UACnC,QAAwB;IACvB,OAAA,IAAA,oBAAY,EAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,UAAA,EAAE,CAAC;AAA3D,CAA2D,CAAA;AAFhD,QAAA,oBAAoB,wBAE4B;AAOhD,QAAA,iBAAiB,GAAsB,EAAE,IAAI,EAAE,mBAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,yBAAa,CAAC,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RuleMoveCommon, RuleMoveType } from './RuleMove';
|
|
2
|
-
import { MaterialMove } from '../MaterialMove';
|
|
3
|
-
export declare type StartSimultaneousRule<Player extends number = number, RuleId extends number = number> = RuleMoveCommon & {
|
|
4
|
-
type: typeof RuleMoveType.StartSimultaneousRule;
|
|
5
|
-
id: RuleId;
|
|
6
|
-
players?: Player[];
|
|
7
|
-
memory?: Record<string, any>;
|
|
8
|
-
playersMemory?: Partial<Record<Player, Record<string, any>>>;
|
|
9
|
-
};
|
|
10
|
-
export declare function isStartSimultaneousRule<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is StartSimultaneousRule<P>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isStartSimultaneousRule = void 0;
|
|
4
|
-
var RuleMove_1 = require("./RuleMove");
|
|
5
|
-
var MoveKind_1 = require("../MoveKind");
|
|
6
|
-
function isStartSimultaneousRule(move) {
|
|
7
|
-
return move.kind === MoveKind_1.MoveKind.RulesMove && move.type === RuleMove_1.RuleMoveType.StartSimultaneousRule;
|
|
8
|
-
}
|
|
9
|
-
exports.isStartSimultaneousRule = isStartSimultaneousRule;
|
|
10
|
-
//# sourceMappingURL=StartSimultanousRule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StartSimultanousRule.js","sourceRoot":"","sources":["../../../../src/material/moves/rules/StartSimultanousRule.ts"],"names":[],"mappings":";;;AAAA,uCAAyD;AAEzD,wCAAsC;AAUtC,SAAgB,uBAAuB,CAAuD,IAA2B;IACvH,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,uBAAY,CAAC,qBAAqB,CAAA;AAC7F,CAAC;AAFD,0DAEC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { EnumOption } from './EnumOption';
|
|
2
|
-
export declare type PlayerIdSpec<Id> = EnumOption<Id> & {
|
|
3
|
-
mandatory?: (players: number) => Id[];
|
|
4
|
-
unavailable?: (players: number) => Id[];
|
|
5
|
-
};
|
|
6
|
-
export declare function getMandatoryIds<Id>(spec: PlayerIdSpec<Id>, players: number): Id[];
|
|
7
|
-
export declare function getAvailableIds<Id>(spec: PlayerIdSpec<Id>, players: number): Id[];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAvailableIds = exports.getMandatoryIds = void 0;
|
|
4
|
-
function getMandatoryIds(spec, players) {
|
|
5
|
-
return spec.mandatory ? spec.mandatory(players) : [];
|
|
6
|
-
}
|
|
7
|
-
exports.getMandatoryIds = getMandatoryIds;
|
|
8
|
-
function getAvailableIds(spec, players) {
|
|
9
|
-
if (spec.unavailable) {
|
|
10
|
-
var unavailableIds_1 = spec.unavailable(players);
|
|
11
|
-
return spec.values.filter(function (id) { return !unavailableIds_1.includes(id); });
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return spec.values;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.getAvailableIds = getAvailableIds;
|
|
18
|
-
//# sourceMappingURL=PlayerIdSpec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlayerIdSpec.js","sourceRoot":"","sources":["../../src/options/PlayerIdSpec.ts"],"names":[],"mappings":";;;AAOA,SAAgB,eAAe,CAAK,IAAsB,EAAE,OAAe;IACzE,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACtD,CAAC;AAFD,0CAEC;AAED,SAAgB,eAAe,CAAK,IAAsB,EAAE,OAAe;IACzE,IAAI,IAAI,CAAC,WAAW,EAAE;QACpB,IAAM,gBAAc,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAA,EAAE,IAAI,OAAA,CAAC,gBAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,EAA5B,CAA4B,CAAC,CAAA;KAC9D;SAAM;QACL,OAAO,IAAI,CAAC,MAAM,CAAA;KACnB;AACH,CAAC;AAPD,0CAOC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
2
|
-
import { OptionsSpec } from './OptionsSpec';
|
|
3
|
-
import { WithIdOption } from './WithIdOption';
|
|
4
|
-
export declare function getFallbackPlayerName<Id, P extends WithIdOption<Id>, Options>(id: Id, t: TFunction, optionsSpec?: OptionsSpec<Options>): string;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFallbackPlayerName = void 0;
|
|
4
|
-
var isWithPlayerIdOptions_1 = require("./isWithPlayerIdOptions");
|
|
5
|
-
function getFallbackPlayerName(id, t, optionsSpec) {
|
|
6
|
-
if (optionsSpec && (0, isWithPlayerIdOptions_1.isWithPlayerIdOptions)(optionsSpec)) {
|
|
7
|
-
return optionsSpec.players.id.valueSpec(id).label(t);
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
return t('Player {number}', { number: id });
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.getFallbackPlayerName = getFallbackPlayerName;
|
|
14
|
-
//# sourceMappingURL=getFallbackPlayerName.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFallbackPlayerName.js","sourceRoot":"","sources":["../../src/options/getFallbackPlayerName.ts"],"names":[],"mappings":";;;AACA,iEAA+D;AAI/D,SAAgB,qBAAqB,CAA0C,EAAM,EAAE,CAAY,EAAE,WAAkC;IACrI,IAAI,WAAW,IAAI,IAAA,6CAAqB,EAAiB,WAAW,CAAC,EAAE;QACrE,OAAO,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;KACrD;SAAM;QACL,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAC,MAAM,EAAE,EAAE,EAAC,CAAC,CAAA;KAC1C;AACH,CAAC;AAND,sDAMC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { WithIdOption } from './WithIdOption';
|
|
2
|
-
import { WithPlayersOptions } from './WithPlayersOptions';
|
|
3
|
-
export declare function providePlayerIds(players: number): number[];
|
|
4
|
-
export declare function providePlayerIds<Options>(players: number, options: Options): number[];
|
|
5
|
-
export declare function providePlayerIds<Id, Player extends WithIdOption<Id>, Options extends WithPlayersOptions<Player>>(players: number, options: Options): Id[];
|
|
6
|
-
export declare function providePlayerIds<Id, Player extends WithIdOption<Id>, Options extends WithPlayersOptions<Player>>(players: (Id | null)[], options: Options): Id[];
|