@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,16 +1,52 @@
|
|
|
1
1
|
import { MaterialItem } from '../items';
|
|
2
2
|
import { Location } from '../location';
|
|
3
3
|
import { CustomMove, DisplayHelp, DropItem, EndGame, EndPlayerTurn, HelpDisplay, StartPlayerTurn, StartRule, StartSimultaneousRule } from './index';
|
|
4
|
+
/**
|
|
5
|
+
* Common namespaces for all the helper function that creates the different types of {@link MaterialMove} objects.
|
|
6
|
+
*/
|
|
4
7
|
export declare namespace MaterialMoveBuilder {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a {@link StartPlayerTurn} object
|
|
10
|
+
*/
|
|
5
11
|
const startPlayerTurn: <P extends number = number, R extends number = number>(id: R, player: P) => StartPlayerTurn<P, R>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a {@link StartSimultaneousRule} object
|
|
14
|
+
*/
|
|
6
15
|
const startSimultaneousRule: <P extends number = number, R extends number = number>(id: R, players?: P[]) => StartSimultaneousRule<P, R>;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a {@link EndPlayerTurn} object
|
|
18
|
+
*/
|
|
7
19
|
const endPlayerTurn: <P extends number = number>(player: P) => EndPlayerTurn<P>;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a {@link StartRule} object
|
|
22
|
+
*/
|
|
8
23
|
const startRule: <R extends number = number>(id: R) => StartRule<R>;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a {@link CustomMove} object
|
|
26
|
+
*/
|
|
9
27
|
const customMove: <Type extends number = number>(type: Type, data?: any) => CustomMove;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a {@link EndGame} object
|
|
30
|
+
*/
|
|
10
31
|
const endGame: () => EndGame;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a {@link DisplayHelp} object
|
|
34
|
+
*/
|
|
11
35
|
const displayHelp: <P extends number = number, M extends number = number, L extends number = number>(helpDisplay: HelpDisplay<P, M, L>) => DisplayHelp<P, M, L>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a {@link DisplayHelp} object holding a {@link MaterialHelpDisplay}
|
|
38
|
+
*/
|
|
12
39
|
const displayMaterialHelp: <P extends number = number, M extends number = number, L extends number = number>(itemType: M, item?: Partial<MaterialItem<P, L>>, itemIndex?: number, displayIndex?: number) => DisplayHelp<P, M, L>;
|
|
40
|
+
/**
|
|
41
|
+
* Creates a {@link DisplayHelp} object holding a {@link LocationHelpDisplay}
|
|
42
|
+
*/
|
|
13
43
|
const displayLocationHelp: <P extends number = number, M extends number = number, L extends number = number>(location: Location<P, L>) => DisplayHelp<P, M, L>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a {@link DisplayHelp} object holding a {@link RulesHelpDisplay}
|
|
46
|
+
*/
|
|
14
47
|
const displayRulesHelp: <P extends number = number, M extends number = number, L extends number = number, RuleId extends number = number>(ruleId: RuleId) => DisplayHelp<P, M, L>;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a {@link DropItem} object
|
|
50
|
+
*/
|
|
15
51
|
function dropItemMove<M extends number = number>(type: M, index: number, displayIndex: number): DropItem<M>;
|
|
16
52
|
}
|
|
@@ -2,41 +2,77 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MaterialMoveBuilder = void 0;
|
|
4
4
|
var index_1 = require("./index");
|
|
5
|
+
/**
|
|
6
|
+
* Common namespaces for all the helper function that creates the different types of {@link MaterialMove} objects.
|
|
7
|
+
*/
|
|
5
8
|
var MaterialMoveBuilder;
|
|
6
9
|
(function (MaterialMoveBuilder) {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a {@link StartPlayerTurn} object
|
|
12
|
+
*/
|
|
7
13
|
MaterialMoveBuilder.startPlayerTurn = function (id, player) {
|
|
8
14
|
return ({ kind: index_1.MoveKind.RulesMove, type: index_1.RuleMoveType.StartPlayerTurn, id: id, player: player });
|
|
9
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Creates a {@link StartSimultaneousRule} object
|
|
18
|
+
*/
|
|
10
19
|
MaterialMoveBuilder.startSimultaneousRule = function (id, players) {
|
|
11
20
|
var move = { kind: index_1.MoveKind.RulesMove, type: index_1.RuleMoveType.StartSimultaneousRule, id: id };
|
|
12
21
|
if (players)
|
|
13
22
|
move.players = players;
|
|
14
23
|
return move;
|
|
15
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Creates a {@link EndPlayerTurn} object
|
|
27
|
+
*/
|
|
16
28
|
MaterialMoveBuilder.endPlayerTurn = function (player) {
|
|
17
29
|
return ({ kind: index_1.MoveKind.RulesMove, type: index_1.RuleMoveType.EndPlayerTurn, player: player });
|
|
18
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Creates a {@link StartRule} object
|
|
33
|
+
*/
|
|
19
34
|
MaterialMoveBuilder.startRule = function (id) { return ({ kind: index_1.MoveKind.RulesMove, type: index_1.RuleMoveType.StartRule, id: id }); };
|
|
35
|
+
/**
|
|
36
|
+
* Creates a {@link CustomMove} object
|
|
37
|
+
*/
|
|
20
38
|
MaterialMoveBuilder.customMove = function (type, data) {
|
|
21
39
|
var move = { kind: index_1.MoveKind.CustomMove, type: type };
|
|
22
40
|
if (data !== undefined)
|
|
23
41
|
move.data = data;
|
|
24
42
|
return move;
|
|
25
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Creates a {@link EndGame} object
|
|
46
|
+
*/
|
|
26
47
|
MaterialMoveBuilder.endGame = function () { return ({ kind: index_1.MoveKind.RulesMove, type: index_1.RuleMoveType.EndGame }); };
|
|
48
|
+
/**
|
|
49
|
+
* Creates a {@link DisplayHelp} object
|
|
50
|
+
*/
|
|
27
51
|
MaterialMoveBuilder.displayHelp = function (helpDisplay) {
|
|
28
52
|
return ({ kind: index_1.MoveKind.LocalMove, type: index_1.LocalMoveType.DisplayHelp, helpDisplay: helpDisplay });
|
|
29
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Creates a {@link DisplayHelp} object holding a {@link MaterialHelpDisplay}
|
|
56
|
+
*/
|
|
30
57
|
MaterialMoveBuilder.displayMaterialHelp = function (itemType, item, itemIndex, displayIndex) {
|
|
31
58
|
if (item === void 0) { item = {}; }
|
|
32
59
|
return MaterialMoveBuilder.displayHelp({ type: index_1.HelpDisplayType.Material, itemType: itemType, itemIndex: itemIndex, displayIndex: displayIndex, item: item });
|
|
33
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Creates a {@link DisplayHelp} object holding a {@link LocationHelpDisplay}
|
|
63
|
+
*/
|
|
34
64
|
MaterialMoveBuilder.displayLocationHelp = function (location) {
|
|
35
65
|
return MaterialMoveBuilder.displayHelp({ type: index_1.HelpDisplayType.Location, location: location });
|
|
36
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Creates a {@link DisplayHelp} object holding a {@link RulesHelpDisplay}
|
|
69
|
+
*/
|
|
37
70
|
MaterialMoveBuilder.displayRulesHelp = function (ruleId) {
|
|
38
71
|
return MaterialMoveBuilder.displayHelp({ type: index_1.HelpDisplayType.Rules, ruleId: ruleId });
|
|
39
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Creates a {@link DropItem} object
|
|
75
|
+
*/
|
|
40
76
|
function dropItemMove(type, index, displayIndex) {
|
|
41
77
|
return { kind: index_1.MoveKind.LocalMove, type: index_1.LocalMoveType.DropItem, item: { type: type, index: index, displayIndex: displayIndex } };
|
|
42
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialMoveBuilder.js","sourceRoot":"","sources":["../../../src/material/moves/MaterialMoveBuilder.ts"],"names":[],"mappings":";;;AAEA,iCAWgB;
|
|
1
|
+
{"version":3,"file":"MaterialMoveBuilder.js","sourceRoot":"","sources":["../../../src/material/moves/MaterialMoveBuilder.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MoveKind = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The different kind of moves that exists in a game implemented with {@link MaterialRules}.
|
|
6
|
+
*/
|
|
4
7
|
var MoveKind;
|
|
5
8
|
(function (MoveKind) {
|
|
6
9
|
MoveKind[MoveKind["ItemMove"] = 1] = "ItemMove";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoveKind.js","sourceRoot":"","sources":["../../../src/material/moves/MoveKind.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"MoveKind.js","sourceRoot":"","sources":["../../../src/material/moves/MoveKind.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,QAEX;AAFD,WAAY,QAAQ;IAClB,+CAAY,CAAA;IAAE,iDAAa,CAAA;IAAE,mDAAc,CAAA;IAAE,iDAAa,CAAA;AAC5D,CAAC,EAFW,QAAQ,wBAAR,QAAQ,QAEnB"}
|
|
@@ -2,9 +2,22 @@ import { MaterialItem } from '../../items';
|
|
|
2
2
|
import { ItemMoveType } from './ItemMoveType';
|
|
3
3
|
import { MaterialMoveCommon } from './ItemMove';
|
|
4
4
|
import { MaterialMove } from '../MaterialMove';
|
|
5
|
+
/**
|
|
6
|
+
* Move object that will create one {@link MaterialItem} when played
|
|
7
|
+
*/
|
|
5
8
|
export type CreateItem<P extends number = number, M extends number = number, L extends number = number> = MaterialMoveCommon<M> & {
|
|
6
9
|
type: typeof ItemMoveType.Create;
|
|
7
10
|
item: MaterialItem<P, L>;
|
|
8
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Type guard to test if a {@link MaterialMove} is a {@link CreateItem} move
|
|
14
|
+
* @param move Move to test
|
|
15
|
+
* @returns true if move is a {@link CreateItem}
|
|
16
|
+
*/
|
|
9
17
|
export declare function isCreateItem<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is CreateItem<P, M, L>;
|
|
18
|
+
/**
|
|
19
|
+
* Function to get a type guard for a {@link CreateItem} move for specific item types.
|
|
20
|
+
* @param type Item type to test
|
|
21
|
+
* @returns a type guard similar as {@link isCreateItem} but that also verify the item type.
|
|
22
|
+
*/
|
|
10
23
|
export declare function isCreateItemType<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is CreateItem<P, M, L>;
|
|
@@ -3,10 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isCreateItemType = exports.isCreateItem = void 0;
|
|
4
4
|
var ItemMoveType_1 = require("./ItemMoveType");
|
|
5
5
|
var MoveKind_1 = require("../MoveKind");
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to test if a {@link MaterialMove} is a {@link CreateItem} move
|
|
8
|
+
* @param move Move to test
|
|
9
|
+
* @returns true if move is a {@link CreateItem}
|
|
10
|
+
*/
|
|
6
11
|
function isCreateItem(move) {
|
|
7
12
|
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Create;
|
|
8
13
|
}
|
|
9
14
|
exports.isCreateItem = isCreateItem;
|
|
15
|
+
/**
|
|
16
|
+
* Function to get a type guard for a {@link CreateItem} move for specific item types.
|
|
17
|
+
* @param type Item type to test
|
|
18
|
+
* @returns a type guard similar as {@link isCreateItem} but that also verify the item type.
|
|
19
|
+
*/
|
|
10
20
|
function isCreateItemType(type) {
|
|
11
21
|
return function (move) {
|
|
12
22
|
return isCreateItem(move) && move.itemType === type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/CreateItem.ts"],"names":[],"mappings":";;;AACA,+CAA6C;AAG7C,wCAAsC;
|
|
1
|
+
{"version":3,"file":"CreateItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/CreateItem.ts"],"names":[],"mappings":";;;AACA,+CAA6C;AAG7C,wCAAsC;AAUtC;;;;GAIG;AACH,SAAgB,YAAY,CAAuD,IAA2B;IAC5G,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,MAAM,CAAA;AAC7E,CAAC;AAFD,oCAEC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,IAAO;IAEP,OAAO,UAAC,IAA2B;QACjC,OAAA,YAAY,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;IAA5C,CAA4C,CAAA;AAChD,CAAC;AALD,4CAKC"}
|
|
@@ -2,9 +2,23 @@ import { MaterialItem } from '../../items';
|
|
|
2
2
|
import { ItemMoveType } from './ItemMoveType';
|
|
3
3
|
import { MaterialMoveCommon } from './ItemMove';
|
|
4
4
|
import { MaterialMove } from '../MaterialMove';
|
|
5
|
+
/**
|
|
6
|
+
* Move object that will create multiple {@link MaterialItem} when played.
|
|
7
|
+
* Use it when you create a lot of items at once and do not need to animate them, to reduce the data payload.
|
|
8
|
+
*/
|
|
5
9
|
export type CreateItemsAtOnce<P extends number = number, M extends number = number, L extends number = number> = MaterialMoveCommon<M> & {
|
|
6
10
|
type: typeof ItemMoveType.CreateAtOnce;
|
|
7
11
|
items: MaterialItem<P, L>[];
|
|
8
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Type guard to test if a {@link MaterialMove} is a {@link CreateItemsAtOnce} move
|
|
15
|
+
* @param move Move to test
|
|
16
|
+
* @returns true if move is a {@link CreateItemsAtOnce}
|
|
17
|
+
*/
|
|
9
18
|
export declare function isCreateItemsAtOnce<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is CreateItemsAtOnce<P, M, L>;
|
|
19
|
+
/**
|
|
20
|
+
* Function to get a type guard for a {@link CreateItemsAtOnce} move for specific item types.
|
|
21
|
+
* @param type Item type to test
|
|
22
|
+
* @returns a type guard similar as {@link isCreateItemsAtOnce} but that also verify the item type.
|
|
23
|
+
*/
|
|
10
24
|
export declare function isCreateItemTypeAtOnce<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is CreateItemsAtOnce<P, M, L>;
|
|
@@ -3,10 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isCreateItemTypeAtOnce = exports.isCreateItemsAtOnce = void 0;
|
|
4
4
|
var ItemMoveType_1 = require("./ItemMoveType");
|
|
5
5
|
var MoveKind_1 = require("../MoveKind");
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to test if a {@link MaterialMove} is a {@link CreateItemsAtOnce} move
|
|
8
|
+
* @param move Move to test
|
|
9
|
+
* @returns true if move is a {@link CreateItemsAtOnce}
|
|
10
|
+
*/
|
|
6
11
|
function isCreateItemsAtOnce(move) {
|
|
7
12
|
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.CreateAtOnce;
|
|
8
13
|
}
|
|
9
14
|
exports.isCreateItemsAtOnce = isCreateItemsAtOnce;
|
|
15
|
+
/**
|
|
16
|
+
* Function to get a type guard for a {@link CreateItemsAtOnce} move for specific item types.
|
|
17
|
+
* @param type Item type to test
|
|
18
|
+
* @returns a type guard similar as {@link isCreateItemsAtOnce} but that also verify the item type.
|
|
19
|
+
*/
|
|
10
20
|
function isCreateItemTypeAtOnce(type) {
|
|
11
21
|
return function (move) {
|
|
12
22
|
return isCreateItemsAtOnce(move) && move.itemType === type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateItemsAtOnce.js","sourceRoot":"","sources":["../../../../src/material/moves/items/CreateItemsAtOnce.ts"],"names":[],"mappings":";;;AACA,+CAA6C;AAG7C,wCAAsC;
|
|
1
|
+
{"version":3,"file":"CreateItemsAtOnce.js","sourceRoot":"","sources":["../../../../src/material/moves/items/CreateItemsAtOnce.ts"],"names":[],"mappings":";;;AACA,+CAA6C;AAG7C,wCAAsC;AAWtC;;;;GAIG;AACH,SAAgB,mBAAmB,CAAuD,IAA2B;IACnH,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,YAAY,CAAA;AACnF,CAAC;AAFD,kDAEC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CACpC,IAAO;IAEP,OAAO,UAAC,IAA2B;QACjC,OAAA,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;IAAnD,CAAmD,CAAA;AACvD,CAAC;AALD,wDAKC"}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { ItemMoveType } from './ItemMoveType';
|
|
2
2
|
import { MaterialMoveCommon } from './ItemMove';
|
|
3
3
|
import { MaterialMove } from '../MaterialMove';
|
|
4
|
+
/**
|
|
5
|
+
* Move object that will delete one {@link MaterialItem}, or a part of its quantity, when played
|
|
6
|
+
* Use {@link Material} utility to build the move easily
|
|
7
|
+
*
|
|
8
|
+
* @property itemIndex index of the item to delete
|
|
9
|
+
* @property quantity if provided, removes the specified quantity from the item. Otherwise, remove all the item.
|
|
10
|
+
*/
|
|
4
11
|
export type DeleteItem<MaterialType extends number = number> = MaterialMoveCommon<MaterialType> & {
|
|
5
12
|
type: typeof ItemMoveType.Delete;
|
|
6
13
|
itemIndex: number;
|
|
7
14
|
quantity?: number;
|
|
8
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Type guard to test if a {@link MaterialMove} is a {@link DeleteItem} move
|
|
18
|
+
* @param move Move to test
|
|
19
|
+
* @returns true if move is a {@link DeleteItem}
|
|
20
|
+
*/
|
|
9
21
|
export declare function isDeleteItem<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is DeleteItem<M>;
|
|
22
|
+
/**
|
|
23
|
+
* Function to get a type guard for a {@link DeleteItem} move for specific item types.
|
|
24
|
+
* @param type Item type to test
|
|
25
|
+
* @param index Optional itemIndex to test along the item type
|
|
26
|
+
* @returns a type guard similar as {@link isDeleteItem} but that also verify the item type.
|
|
27
|
+
*/
|
|
10
28
|
export declare function isDeleteItemType<P extends number, M extends number, L extends number>(type: M, index?: number): (move: MaterialMove<P, M, L>) => move is DeleteItem<M>;
|
|
@@ -3,10 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isDeleteItemType = exports.isDeleteItem = void 0;
|
|
4
4
|
var ItemMoveType_1 = require("./ItemMoveType");
|
|
5
5
|
var MoveKind_1 = require("../MoveKind");
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to test if a {@link MaterialMove} is a {@link DeleteItem} move
|
|
8
|
+
* @param move Move to test
|
|
9
|
+
* @returns true if move is a {@link DeleteItem}
|
|
10
|
+
*/
|
|
6
11
|
function isDeleteItem(move) {
|
|
7
12
|
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Delete;
|
|
8
13
|
}
|
|
9
14
|
exports.isDeleteItem = isDeleteItem;
|
|
15
|
+
/**
|
|
16
|
+
* Function to get a type guard for a {@link DeleteItem} move for specific item types.
|
|
17
|
+
* @param type Item type to test
|
|
18
|
+
* @param index Optional itemIndex to test along the item type
|
|
19
|
+
* @returns a type guard similar as {@link isDeleteItem} but that also verify the item type.
|
|
20
|
+
*/
|
|
10
21
|
function isDeleteItemType(type, index) {
|
|
11
22
|
return function (move) {
|
|
12
23
|
return isDeleteItem(move) && move.itemType === type && (index === undefined || move.itemIndex === index);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/DeleteItem.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAG7C,wCAAsC;
|
|
1
|
+
{"version":3,"file":"DeleteItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/DeleteItem.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAG7C,wCAAsC;AAetC;;;;GAIG;AACH,SAAgB,YAAY,CAAuD,IAA2B;IAC5G,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,MAAM,CAAA;AAC7E,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,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,SAAS,KAAK,KAAK,CAAC;IAAjG,CAAiG,CAAA;AACrG,CAAC;AALD,4CAKC"}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { MaterialMove } from '../MaterialMove';
|
|
2
2
|
import { MaterialMoveCommon } from './ItemMove';
|
|
3
3
|
import { ItemMoveType } from './ItemMoveType';
|
|
4
|
+
/**
|
|
5
|
+
* Move object that will delete multiple {@link MaterialItem} when played.
|
|
6
|
+
* Use {@link Material} utility to build the move easily.
|
|
7
|
+
* Use this when you need to delete a lot of items without animating it one by one, to reduce the data payload.
|
|
8
|
+
*
|
|
9
|
+
* @property indexes indexes of the items to delete
|
|
10
|
+
*/
|
|
4
11
|
export type DeleteItemsAtOnce<MaterialType extends number = number> = MaterialMoveCommon<MaterialType> & {
|
|
5
12
|
type: typeof ItemMoveType.DeleteAtOnce;
|
|
6
13
|
indexes: number[];
|
|
7
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Type guard to test if a {@link MaterialMove} is a {@link DeleteItemsAtOnce} move
|
|
17
|
+
* @param move Move to test
|
|
18
|
+
* @returns true if move is a {@link DeleteItemsAtOnce}
|
|
19
|
+
*/
|
|
8
20
|
export declare function isDeleteItemsAtOnce<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is DeleteItemsAtOnce<M>;
|
|
21
|
+
/**
|
|
22
|
+
* Function to get a type guard for a {@link DeleteItemsAtOnce} move for specific item types.
|
|
23
|
+
* @param type Item type to test
|
|
24
|
+
* @returns a type guard similar as {@link isDeleteItemsAtOnce} but that also verify the item type.
|
|
25
|
+
*/
|
|
9
26
|
export declare function isDeleteItemTypeAtOnce<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is DeleteItemsAtOnce<M>;
|
|
@@ -3,10 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isDeleteItemTypeAtOnce = exports.isDeleteItemsAtOnce = void 0;
|
|
4
4
|
var MoveKind_1 = require("../MoveKind");
|
|
5
5
|
var ItemMoveType_1 = require("./ItemMoveType");
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to test if a {@link MaterialMove} is a {@link DeleteItemsAtOnce} move
|
|
8
|
+
* @param move Move to test
|
|
9
|
+
* @returns true if move is a {@link DeleteItemsAtOnce}
|
|
10
|
+
*/
|
|
6
11
|
function isDeleteItemsAtOnce(move) {
|
|
7
12
|
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.DeleteAtOnce;
|
|
8
13
|
}
|
|
9
14
|
exports.isDeleteItemsAtOnce = isDeleteItemsAtOnce;
|
|
15
|
+
/**
|
|
16
|
+
* Function to get a type guard for a {@link DeleteItemsAtOnce} move for specific item types.
|
|
17
|
+
* @param type Item type to test
|
|
18
|
+
* @returns a type guard similar as {@link isDeleteItemsAtOnce} but that also verify the item type.
|
|
19
|
+
*/
|
|
10
20
|
function isDeleteItemTypeAtOnce(type) {
|
|
11
21
|
return function (move) {
|
|
12
22
|
return isDeleteItemsAtOnce(move) && move.itemType === type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteItemsAtOnce.js","sourceRoot":"","sources":["../../../../src/material/moves/items/DeleteItemsAtOnce.ts"],"names":[],"mappings":";;;AACA,wCAAsC;AAEtC,+CAA6C;
|
|
1
|
+
{"version":3,"file":"DeleteItemsAtOnce.js","sourceRoot":"","sources":["../../../../src/material/moves/items/DeleteItemsAtOnce.ts"],"names":[],"mappings":";;;AACA,wCAAsC;AAEtC,+CAA6C;AAc7C;;;;GAIG;AACH,SAAgB,mBAAmB,CAAuD,IAA2B;IACnH,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,YAAY,CAAA;AACnF,CAAC;AAFD,kDAEC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CACpC,IAAO;IAEP,OAAO,UAAC,IAA2B;QACjC,OAAA,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;IAAnD,CAAmD,CAAA;AACvD,CAAC;AALD,wDAKC"}
|
|
@@ -8,10 +8,22 @@ import { MoveItem } from './MoveItem';
|
|
|
8
8
|
import { RollItem } from './RollItem';
|
|
9
9
|
import { SelectItem } from './SelectItem';
|
|
10
10
|
import { Shuffle, ShuffleRandomized } from './Shuffle';
|
|
11
|
+
/**
|
|
12
|
+
* Common type for all the moves that have an impact on the game material items
|
|
13
|
+
*/
|
|
11
14
|
export type ItemMove<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = CreateItem<Player, MaterialType, LocationType> | CreateItemsAtOnce<Player, MaterialType, LocationType> | DeleteItem<MaterialType> | DeleteItemsAtOnce<MaterialType> | MoveItem<Player, MaterialType, LocationType> | MoveItemsAtOnce<Player, MaterialType, LocationType> | Shuffle<MaterialType> | RollItem<Player, MaterialType, LocationType> | SelectItem<MaterialType>;
|
|
15
|
+
/**
|
|
16
|
+
* Common properties for all the types of {@link ItemMove}
|
|
17
|
+
*/
|
|
12
18
|
export type MaterialMoveCommon<MaterialType extends number = number> = {
|
|
13
19
|
kind: typeof MoveKind.ItemMove;
|
|
14
20
|
itemType: MaterialType;
|
|
15
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* An {@link ItemMove} but after if has been randomized (see {@link RandomMove})
|
|
24
|
+
*/
|
|
16
25
|
export type ItemMoveRandomized<P extends number = number, M extends number = number, L extends number = number> = Exclude<ItemMove<P, M, L>, Shuffle<M>> | ShuffleRandomized<M>;
|
|
26
|
+
/**
|
|
27
|
+
* An {@link ItemMove} but after if has been transformed into what a player or a spectator can view (see {@link HiddenInformation})
|
|
28
|
+
*/
|
|
17
29
|
export type ItemMoveView<P extends number = number, M extends number = number, L extends number = number> = Exclude<ItemMoveRandomized<P, M, L>, ShuffleRandomized<M>> | Shuffle<M>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ItemMoveType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The different types of {@link ItemMove}
|
|
6
|
+
*/
|
|
4
7
|
var ItemMoveType;
|
|
5
8
|
(function (ItemMoveType) {
|
|
6
9
|
ItemMoveType[ItemMoveType["Create"] = 0] = "Create";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemMoveType.js","sourceRoot":"","sources":["../../../../src/material/moves/items/ItemMoveType.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ItemMoveType.js","sourceRoot":"","sources":["../../../../src/material/moves/items/ItemMoveType.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,YAEX;AAFD,WAAY,YAAY;IACtB,mDAAM,CAAA;IAAE,+CAAI,CAAA;IAAE,qDAAO,CAAA;IAAE,mDAAM,CAAA;IAAE,+CAAI,CAAA;IAAE,mDAAM,CAAA;IAAE,2DAAU,CAAA;IAAE,+DAAY,CAAA;IAAE,+DAAY,CAAA;AACrF,CAAC,EAFW,YAAY,4BAAZ,YAAY,QAEvB"}
|
|
@@ -3,6 +3,15 @@ import { Location } from '../../location';
|
|
|
3
3
|
import { MaterialMove } from '../MaterialMove';
|
|
4
4
|
import { MaterialMoveCommon } from './ItemMove';
|
|
5
5
|
import { ItemMoveType } from './ItemMoveType';
|
|
6
|
+
/**
|
|
7
|
+
* Move object that will move one existing {@link MaterialItem} (or a part of its quantity) to a new location, when played
|
|
8
|
+
* Use {@link Material} utility to build the move easily
|
|
9
|
+
*
|
|
10
|
+
* @property itemIndex index of the item to move
|
|
11
|
+
* @property location the new location
|
|
12
|
+
* @property quantity if provided, move the specified quantity from the item (split in two items). Otherwise, move all the item.
|
|
13
|
+
* @property reveal this property automatically set inside {@link HiddenMaterialRules} to provides any extra information about the item revealed by the move
|
|
14
|
+
*/
|
|
6
15
|
export type MoveItem<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = MaterialMoveCommon<MaterialType> & {
|
|
7
16
|
type: typeof ItemMoveType.Move;
|
|
8
17
|
itemIndex: number;
|
|
@@ -10,5 +19,16 @@ export type MoveItem<Player extends number = number, MaterialType extends number
|
|
|
10
19
|
quantity?: number;
|
|
11
20
|
reveal?: Omit<MaterialItem<Player, LocationType>, 'location'>;
|
|
12
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Type guard to test if a {@link MaterialMove} is a {@link MoveItem} move
|
|
24
|
+
* @param move Move to test
|
|
25
|
+
* @returns true if move is a {@link MoveItem}
|
|
26
|
+
*/
|
|
13
27
|
export declare function isMoveItem<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is MoveItem<P, M, L>;
|
|
28
|
+
/**
|
|
29
|
+
* Function to get a type guard for a {@link MoveItem} move for specific item types.
|
|
30
|
+
* @param type Item type to test
|
|
31
|
+
* @param index Optional itemIndex to test along the item type
|
|
32
|
+
* @returns a type guard similar as {@link isMoveItem} but that also verify the item type.
|
|
33
|
+
*/
|
|
14
34
|
export declare function isMoveItemType<P extends number, M extends number, L extends number>(type: M, index?: number): (move: MaterialMove<P, M, L>) => move is MoveItem<P, M, L>;
|
|
@@ -3,10 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isMoveItemType = exports.isMoveItem = void 0;
|
|
4
4
|
var MoveKind_1 = require("../MoveKind");
|
|
5
5
|
var ItemMoveType_1 = require("./ItemMoveType");
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to test if a {@link MaterialMove} is a {@link MoveItem} move
|
|
8
|
+
* @param move Move to test
|
|
9
|
+
* @returns true if move is a {@link MoveItem}
|
|
10
|
+
*/
|
|
6
11
|
function isMoveItem(move) {
|
|
7
12
|
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Move;
|
|
8
13
|
}
|
|
9
14
|
exports.isMoveItem = isMoveItem;
|
|
15
|
+
/**
|
|
16
|
+
* Function to get a type guard for a {@link MoveItem} move for specific item types.
|
|
17
|
+
* @param type Item type to test
|
|
18
|
+
* @param index Optional itemIndex to test along the item type
|
|
19
|
+
* @returns a type guard similar as {@link isMoveItem} but that also verify the item type.
|
|
20
|
+
*/
|
|
10
21
|
function isMoveItemType(type, index) {
|
|
11
22
|
return function (move) {
|
|
12
23
|
return isMoveItem(move) && move.itemType === type && (index === undefined || move.itemIndex === index);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoveItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/MoveItem.ts"],"names":[],"mappings":";;;AAGA,wCAAsC;AAEtC,+CAA6C;
|
|
1
|
+
{"version":3,"file":"MoveItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/MoveItem.ts"],"names":[],"mappings":";;;AAGA,wCAAsC;AAEtC,+CAA6C;AAoB7C;;;;GAIG;AACH,SAAgB,UAAU,CAAuD,IAA2B;IAC1G,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,IAAI,CAAA;AAC3E,CAAC;AAFD,gCAEC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,IAAO,EAAE,KAAc;IAEvB,OAAO,UAAC,IAA2B;QACjC,OAAA,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC;IAA/F,CAA+F,CAAA;AACnG,CAAC;AALD,wCAKC"}
|
|
@@ -3,11 +3,31 @@ import { Location } from '../../location';
|
|
|
3
3
|
import { MaterialMove } from '../MaterialMove';
|
|
4
4
|
import { MaterialMoveCommon } from './ItemMove';
|
|
5
5
|
import { ItemMoveType } from './ItemMoveType';
|
|
6
|
+
/**
|
|
7
|
+
* Move object that will move multiple {@link MaterialItem} to the same new location when played.
|
|
8
|
+
* Any {@link LocationStrategy} will be applied to each item individually.
|
|
9
|
+
* Use {@link Material} utility to build the move easily.
|
|
10
|
+
* Use this when you need to move around a lot of items at once without animating it one by one, to reduce the data payload.
|
|
11
|
+
*
|
|
12
|
+
* @property indexes indexes of the items to delete
|
|
13
|
+
* @property location the new location for the items
|
|
14
|
+
* @property reveal this property automatically set inside {@link HiddenMaterialRules} to provides any extra information about the items revealed by the move
|
|
15
|
+
*/
|
|
6
16
|
export type MoveItemsAtOnce<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = MaterialMoveCommon<MaterialType> & {
|
|
7
17
|
type: typeof ItemMoveType.MoveAtOnce;
|
|
8
18
|
indexes: number[];
|
|
9
19
|
location: Partial<Location<Player, LocationType>>;
|
|
10
20
|
reveal?: Record<number, Omit<MaterialItem<Player, LocationType>, 'location'>>;
|
|
11
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Type guard to test if a {@link MaterialMove} is a {@link MoveItemsAtOnce} move
|
|
24
|
+
* @param move Move to test
|
|
25
|
+
* @returns true if move is a {@link MoveItemsAtOnce}
|
|
26
|
+
*/
|
|
12
27
|
export declare function isMoveItemsAtOnce<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is MoveItemsAtOnce<P, M, L>;
|
|
28
|
+
/**
|
|
29
|
+
* Function to get a type guard for a {@link MoveItemsAtOnce} move for specific item types.
|
|
30
|
+
* @param type Item type to test
|
|
31
|
+
* @returns a type guard similar as {@link isMoveItemsAtOnce} but that also verify the item type.
|
|
32
|
+
*/
|
|
13
33
|
export declare function isMoveItemTypeAtOnce<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is MoveItemsAtOnce<P, M, L>;
|
|
@@ -3,10 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isMoveItemTypeAtOnce = exports.isMoveItemsAtOnce = void 0;
|
|
4
4
|
var MoveKind_1 = require("../MoveKind");
|
|
5
5
|
var ItemMoveType_1 = require("./ItemMoveType");
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to test if a {@link MaterialMove} is a {@link MoveItemsAtOnce} move
|
|
8
|
+
* @param move Move to test
|
|
9
|
+
* @returns true if move is a {@link MoveItemsAtOnce}
|
|
10
|
+
*/
|
|
6
11
|
function isMoveItemsAtOnce(move) {
|
|
7
12
|
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.MoveAtOnce;
|
|
8
13
|
}
|
|
9
14
|
exports.isMoveItemsAtOnce = isMoveItemsAtOnce;
|
|
15
|
+
/**
|
|
16
|
+
* Function to get a type guard for a {@link MoveItemsAtOnce} move for specific item types.
|
|
17
|
+
* @param type Item type to test
|
|
18
|
+
* @returns a type guard similar as {@link isMoveItemsAtOnce} but that also verify the item type.
|
|
19
|
+
*/
|
|
10
20
|
function isMoveItemTypeAtOnce(type) {
|
|
11
21
|
return function (move) {
|
|
12
22
|
return isMoveItemsAtOnce(move) && move.itemType === type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoveItemsAtOnce.js","sourceRoot":"","sources":["../../../../src/material/moves/items/MoveItemsAtOnce.ts"],"names":[],"mappings":";;;AAGA,wCAAsC;AAEtC,+CAA6C;
|
|
1
|
+
{"version":3,"file":"MoveItemsAtOnce.js","sourceRoot":"","sources":["../../../../src/material/moves/items/MoveItemsAtOnce.ts"],"names":[],"mappings":";;;AAGA,wCAAsC;AAEtC,+CAA6C;AAoB7C;;;;GAIG;AACH,SAAgB,iBAAiB,CAAuD,IAA2B;IACjH,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,UAAU,CAAA;AACjF,CAAC;AAFD,8CAEC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAClC,IAAO;IAEP,OAAO,UAAC,IAA2B;QACjC,OAAA,iBAAiB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;IAAjD,CAAiD,CAAA;AACrD,CAAC;AALD,oDAKC"}
|
|
@@ -2,10 +2,29 @@ import { Location } from '../../location';
|
|
|
2
2
|
import { MaterialMove } from '../MaterialMove';
|
|
3
3
|
import { MaterialMoveCommon } from './ItemMove';
|
|
4
4
|
import { ItemMoveType } from './ItemMoveType';
|
|
5
|
+
/**
|
|
6
|
+
* Move object that will "roll" one existing {@link MaterialItem} to a new location, when played.
|
|
7
|
+
* Use {@link Material} utility to build the move easily.
|
|
8
|
+
* Use this to roll dices or flip coins, for instance.
|
|
9
|
+
* Override "roll" function in {@link MaterialRules} to provide a custom and random "location.rotation" value when the server randomizes the move
|
|
10
|
+
*
|
|
11
|
+
* @property itemIndex index of the item to roll
|
|
12
|
+
* @property location the new location (without the rotation when the move is built, then with the randomized location after {@link RandomMove} is applied
|
|
13
|
+
*/
|
|
5
14
|
export type RollItem<P extends number = number, M extends number = number, L extends number = number> = MaterialMoveCommon<M> & {
|
|
6
15
|
type: typeof ItemMoveType.Roll;
|
|
7
16
|
itemIndex: number;
|
|
8
17
|
location: Location<P, L>;
|
|
9
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Type guard to test if a {@link MaterialMove} is a {@link RollItem} move
|
|
21
|
+
* @param move Move to test
|
|
22
|
+
* @returns true if move is a {@link RollItem}
|
|
23
|
+
*/
|
|
10
24
|
export declare function isRoll<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is RollItem<P, M, L>;
|
|
25
|
+
/**
|
|
26
|
+
* Function to get a type guard for a {@link RollItem} move for specific item types.
|
|
27
|
+
* @param type Item type to test
|
|
28
|
+
* @returns a type guard similar as {@link isRoll} but that also verify the item type.
|
|
29
|
+
*/
|
|
11
30
|
export declare function isRollItemType<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is RollItem<P, M, L>;
|
|
@@ -3,10 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isRollItemType = exports.isRoll = void 0;
|
|
4
4
|
var MoveKind_1 = require("../MoveKind");
|
|
5
5
|
var ItemMoveType_1 = require("./ItemMoveType");
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to test if a {@link MaterialMove} is a {@link RollItem} move
|
|
8
|
+
* @param move Move to test
|
|
9
|
+
* @returns true if move is a {@link RollItem}
|
|
10
|
+
*/
|
|
6
11
|
function isRoll(move) {
|
|
7
12
|
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Roll;
|
|
8
13
|
}
|
|
9
14
|
exports.isRoll = isRoll;
|
|
15
|
+
/**
|
|
16
|
+
* Function to get a type guard for a {@link RollItem} move for specific item types.
|
|
17
|
+
* @param type Item type to test
|
|
18
|
+
* @returns a type guard similar as {@link isRoll} but that also verify the item type.
|
|
19
|
+
*/
|
|
10
20
|
function isRollItemType(type) {
|
|
11
21
|
return function (move) {
|
|
12
22
|
return isRoll(move) && move.itemType === type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RollItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/RollItem.ts"],"names":[],"mappings":";;;AAEA,wCAAsC;AAEtC,+CAA6C;
|
|
1
|
+
{"version":3,"file":"RollItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/RollItem.ts"],"names":[],"mappings":";;;AAEA,wCAAsC;AAEtC,+CAA6C;AAiB7C;;;;GAIG;AACH,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;;;;GAIG;AACH,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"}
|