@gamepark/rules-api 6.24.2 → 6.24.3
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 +7 -0
- package/dist/Bot.d.ts +21 -0
- package/dist/Bot.js +18 -2
- package/dist/Bot.js.map +1 -1
- package/dist/Competitive.d.ts +45 -0
- package/dist/Competitive.js +15 -0
- package/dist/Competitive.js.map +1 -1
- package/dist/Eliminations.d.ts +17 -0
- package/dist/Eliminations.js +5 -0
- package/dist/Eliminations.js.map +1 -1
- package/dist/GameSetup.d.ts +14 -0
- package/dist/HiddenInformation.d.ts +22 -0
- package/dist/HiddenInformation.js +5 -0
- package/dist/HiddenInformation.js.map +1 -1
- package/dist/LocalMovePreview.d.ts +14 -0
- package/dist/LocalMovePreview.js +5 -0
- package/dist/LocalMovePreview.js.map +1 -1
- package/dist/RandomMove.d.ts +17 -0
- package/dist/Rules.d.ts +119 -0
- package/dist/Rules.js +102 -1
- package/dist/Rules.js.map +1 -1
- package/dist/SecretInformation.d.ts +39 -0
- package/dist/SecretInformation.js +5 -0
- package/dist/SecretInformation.js.map +1 -1
- package/dist/TimeLimit.d.ts +22 -0
- package/dist/TimeLimit.js +5 -0
- package/dist/TimeLimit.js.map +1 -1
- package/dist/Undo.d.ts +18 -0
- package/dist/Undo.js +6 -0
- package/dist/Undo.js.map +1 -1
- package/dist/UnpredictableMove.d.ts +19 -0
- package/dist/UnpredictableMove.js +5 -0
- package/dist/UnpredictableMove.js.map +1 -1
- package/dist/material/HiddenMaterialRules.d.ts +48 -0
- package/dist/material/HiddenMaterialRules.js +47 -1
- package/dist/material/HiddenMaterialRules.js.map +1 -1
- package/dist/material/MaterialGame.d.ts +12 -0
- package/dist/material/MaterialGameSetup.d.ts +74 -0
- package/dist/material/MaterialGameSetup.js +67 -1
- package/dist/material/MaterialGameSetup.js.map +1 -1
- package/dist/material/MaterialRules.d.ts +125 -0
- package/dist/material/MaterialRules.js +117 -1
- package/dist/material/MaterialRules.js.map +1 -1
- package/dist/material/SecretMaterialRules.d.ts +31 -0
- package/dist/material/SecretMaterialRules.js +23 -1
- package/dist/material/SecretMaterialRules.js.map +1 -1
- package/dist/material/items/Material.d.ts +253 -0
- package/dist/material/items/Material.js +248 -1
- package/dist/material/items/Material.js.map +1 -1
- package/dist/material/items/MaterialDeck.d.ts +33 -0
- package/dist/material/items/MaterialDeck.js +34 -1
- package/dist/material/items/MaterialDeck.js.map +1 -1
- package/dist/material/items/MaterialItem.d.ts +12 -0
- package/dist/material/items/MaterialMutator.d.ts +39 -0
- package/dist/material/items/MaterialMutator.js +41 -2
- package/dist/material/items/MaterialMutator.js.map +1 -1
- package/dist/material/items/index.js +1 -1
- package/dist/material/items/index.js.map +1 -1
- package/dist/material/location/Location.d.ts +28 -0
- package/dist/material/location/Location.js +5 -0
- package/dist/material/location/Location.js.map +1 -1
- package/dist/material/location/LocationBuilder.js +1 -1
- package/dist/material/location/strategy/FillGapStrategy.d.ts +4 -0
- package/dist/material/location/strategy/FillGapStrategy.js +5 -1
- package/dist/material/location/strategy/FillGapStrategy.js.map +1 -1
- package/dist/material/location/strategy/LocationStrategy.d.ts +20 -0
- package/dist/material/location/strategy/PositiveSequenceStrategy.d.ts +4 -0
- package/dist/material/location/strategy/PositiveSequenceStrategy.js +5 -1
- package/dist/material/location/strategy/PositiveSequenceStrategy.js.map +1 -1
- package/dist/material/memory/GameMemory.d.ts +21 -0
- package/dist/material/memory/GameMemory.js +22 -1
- package/dist/material/memory/GameMemory.js.map +1 -1
- package/dist/material/memory/PlayerMemory.d.ts +22 -0
- package/dist/material/memory/PlayerMemory.js +23 -1
- package/dist/material/memory/PlayerMemory.js.map +1 -1
- package/dist/material/moves/CustomMove.d.ts +18 -0
- package/dist/material/moves/CustomMove.js +13 -0
- package/dist/material/moves/CustomMove.js.map +1 -1
- package/dist/material/moves/MaterialMove.d.ts +9 -0
- package/dist/material/moves/MaterialMoveBuilder.d.ts +36 -0
- package/dist/material/moves/MaterialMoveBuilder.js +36 -0
- package/dist/material/moves/MaterialMoveBuilder.js.map +1 -1
- package/dist/material/moves/MoveKind.d.ts +3 -0
- package/dist/material/moves/MoveKind.js +3 -0
- package/dist/material/moves/MoveKind.js.map +1 -1
- package/dist/material/moves/items/CreateItem.d.ts +13 -0
- package/dist/material/moves/items/CreateItem.js +10 -0
- package/dist/material/moves/items/CreateItem.js.map +1 -1
- package/dist/material/moves/items/CreateItemsAtOnce.d.ts +14 -0
- package/dist/material/moves/items/CreateItemsAtOnce.js +10 -0
- package/dist/material/moves/items/CreateItemsAtOnce.js.map +1 -1
- package/dist/material/moves/items/DeleteItem.d.ts +18 -0
- package/dist/material/moves/items/DeleteItem.js +11 -0
- package/dist/material/moves/items/DeleteItem.js.map +1 -1
- package/dist/material/moves/items/DeleteItemsAtOnce.d.ts +17 -0
- package/dist/material/moves/items/DeleteItemsAtOnce.js +10 -0
- package/dist/material/moves/items/DeleteItemsAtOnce.js.map +1 -1
- package/dist/material/moves/items/ItemMove.d.ts +12 -0
- package/dist/material/moves/items/ItemMoveType.d.ts +3 -0
- package/dist/material/moves/items/ItemMoveType.js +3 -0
- package/dist/material/moves/items/ItemMoveType.js.map +1 -1
- package/dist/material/moves/items/MoveItem.d.ts +20 -0
- package/dist/material/moves/items/MoveItem.js +11 -0
- package/dist/material/moves/items/MoveItem.js.map +1 -1
- package/dist/material/moves/items/MoveItemsAtOnce.d.ts +20 -0
- package/dist/material/moves/items/MoveItemsAtOnce.js +10 -0
- package/dist/material/moves/items/MoveItemsAtOnce.js.map +1 -1
- package/dist/material/moves/items/RollItem.d.ts +19 -0
- package/dist/material/moves/items/RollItem.js +10 -0
- package/dist/material/moves/items/RollItem.js.map +1 -1
- package/dist/material/moves/items/SelectItem.d.ts +20 -0
- package/dist/material/moves/items/SelectItem.js +11 -0
- package/dist/material/moves/items/SelectItem.js.map +1 -1
- package/dist/material/moves/items/Shuffle.d.ts +26 -0
- package/dist/material/moves/items/Shuffle.js +15 -0
- package/dist/material/moves/items/Shuffle.js.map +1 -1
- package/dist/material/moves/local/CloseTutorialPopup.d.ts +8 -0
- package/dist/material/moves/local/CloseTutorialPopup.js +5 -0
- package/dist/material/moves/local/CloseTutorialPopup.js.map +1 -1
- package/dist/material/moves/local/DisplayHelp.d.ts +18 -0
- package/dist/material/moves/local/DisplayHelp.js +3 -0
- package/dist/material/moves/local/DisplayHelp.js.map +1 -1
- package/dist/material/moves/local/DropItem.d.ts +9 -0
- package/dist/material/moves/local/LocalMove.d.ts +6 -0
- package/dist/material/moves/local/LocalMove.js +3 -0
- package/dist/material/moves/local/LocalMove.js.map +1 -1
- package/dist/material/moves/local/SetTutorialStep.d.ts +8 -0
- package/dist/material/moves/local/SetTutorialStep.js +5 -0
- package/dist/material/moves/local/SetTutorialStep.js.map +1 -1
- package/dist/material/rules/MaterialRulesPart.d.ts +76 -0
- package/dist/material/rules/MaterialRulesPart.js +74 -1
- package/dist/material/rules/MaterialRulesPart.js.map +1 -1
- package/dist/material/rules/PlayerTurnRule.d.ts +19 -0
- package/dist/material/rules/PlayerTurnRule.js +20 -1
- package/dist/material/rules/PlayerTurnRule.js.map +1 -1
- package/dist/material/rules/RuleStep.d.ts +3 -0
- package/dist/material/rules/SimultaneousRule.d.ts +25 -0
- package/dist/material/rules/SimultaneousRule.js +21 -1
- package/dist/material/rules/SimultaneousRule.js.map +1 -1
- package/dist/material/tutorial/TutorialState.d.ts +7 -0
- package/dist/options/OptionsValidationError.js +1 -1
- package/dist/options/PlayerEnumOption.js +3 -0
- package/dist/options/PlayerEnumOption.js.map +1 -1
- package/dist/utils/action-view.util.js +2 -0
- package/dist/utils/action-view.util.js.map +1 -1
- package/dist/utils/enum.util.d.ts +27 -0
- package/dist/utils/enum.util.js +24 -0
- package/dist/utils/enum.util.js.map +1 -1
- package/dist/utils/grid.squares.util.d.ts +26 -0
- package/dist/utils/grid.squares.util.js +26 -0
- package/dist/utils/grid.squares.util.js.map +1 -1
- package/dist/utils/grid.util.d.ts +8 -0
- package/dist/utils/grid.util.js +5 -0
- package/dist/utils/grid.util.js.map +1 -1
- package/dist/utils/listing.util.d.ts +12 -0
- package/dist/utils/listing.util.js +12 -0
- package/dist/utils/listing.util.js.map +1 -1
- package/dist/utils/money.util.d.ts +41 -4
- package/dist/utils/money.util.js +38 -1
- package/dist/utils/money.util.js.map +1 -1
- package/dist/utils/random.util.d.ts +11 -0
- package/dist/utils/random.util.js +11 -0
- package/dist/utils/random.util.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { RandomMove } from '../RandomMove';
|
|
2
2
|
import { Rules } from '../Rules';
|
|
3
|
+
/**
|
|
4
|
+
* Type guard for rules with Random moves
|
|
5
|
+
* @param rules The game's rules
|
|
6
|
+
* @return true if the rules implements {@link RandomMove} interface
|
|
7
|
+
*/
|
|
3
8
|
export declare function hasRandomMove<Game, Move, RandomizedMove>(rules: Rules<Game, Move>): rules is Rules<Game, Move> & RandomMove<Move, RandomizedMove>;
|
|
9
|
+
/**
|
|
10
|
+
* Randomizes a list of moves at once
|
|
11
|
+
* @param rules Rules of the game
|
|
12
|
+
* @param moves Moves to randomize
|
|
13
|
+
* @returns the randomized moves if the rules implements {@link RandomMove}
|
|
14
|
+
*/
|
|
4
15
|
export declare function randomizeMoves<Game, Move, RandomizedMove = Move>(rules: Rules<Game, Move>, moves: Move[]): (Move & RandomizedMove)[];
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.randomizeMoves = exports.hasRandomMove = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Type guard for rules with Random moves
|
|
6
|
+
* @param rules The game's rules
|
|
7
|
+
* @return true if the rules implements {@link RandomMove} interface
|
|
8
|
+
*/
|
|
4
9
|
function hasRandomMove(rules) {
|
|
5
10
|
var test = rules;
|
|
6
11
|
return typeof test.randomize === 'function';
|
|
7
12
|
}
|
|
8
13
|
exports.hasRandomMove = hasRandomMove;
|
|
14
|
+
/**
|
|
15
|
+
* Randomizes a list of moves at once
|
|
16
|
+
* @param rules Rules of the game
|
|
17
|
+
* @param moves Moves to randomize
|
|
18
|
+
* @returns the randomized moves if the rules implements {@link RandomMove}
|
|
19
|
+
*/
|
|
9
20
|
function randomizeMoves(rules, moves) {
|
|
10
21
|
if (hasRandomMove(rules)) {
|
|
11
22
|
return moves.map(function (move) { return rules.randomize(move); });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.util.js","sourceRoot":"","sources":["../../src/utils/random.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"random.util.js","sourceRoot":"","sources":["../../src/utils/random.util.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,KAAwB;IAExB,IAAM,IAAI,GAAG,KAA6D,CAAA;IAC1E,OAAO,OAAO,IAAI,CAAC,SAAS,KAAK,UAAU,CAAA;AAC7C,CAAC;AALD,sCAKC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAAoC,KAAwB,EAAE,KAAa;IACvG,IAAI,aAAa,CAA6B,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI,IAAI,OAAA,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAArB,CAAqB,CAAC,CAAA;IACjD,CAAC;SAAM,CAAC;QACN,OAAO,KAAkC,CAAA;IAC3C,CAAC;AACH,CAAC;AAND,wCAMC"}
|