@gamepark/rules-api 6.24.2 → 6.25.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.
Files changed (170) hide show
  1. package/dist/Action.d.ts +7 -0
  2. package/dist/Bot.d.ts +21 -0
  3. package/dist/Bot.js +18 -2
  4. package/dist/Bot.js.map +1 -1
  5. package/dist/Competitive.d.ts +45 -0
  6. package/dist/Competitive.js +15 -0
  7. package/dist/Competitive.js.map +1 -1
  8. package/dist/Eliminations.d.ts +17 -0
  9. package/dist/Eliminations.js +5 -0
  10. package/dist/Eliminations.js.map +1 -1
  11. package/dist/GameSetup.d.ts +14 -0
  12. package/dist/HiddenInformation.d.ts +22 -0
  13. package/dist/HiddenInformation.js +5 -0
  14. package/dist/HiddenInformation.js.map +1 -1
  15. package/dist/LocalMovePreview.d.ts +14 -0
  16. package/dist/LocalMovePreview.js +5 -0
  17. package/dist/LocalMovePreview.js.map +1 -1
  18. package/dist/RandomMove.d.ts +20 -2
  19. package/dist/Rules.d.ts +119 -0
  20. package/dist/Rules.js +102 -1
  21. package/dist/Rules.js.map +1 -1
  22. package/dist/SecretInformation.d.ts +39 -0
  23. package/dist/SecretInformation.js +5 -0
  24. package/dist/SecretInformation.js.map +1 -1
  25. package/dist/TimeLimit.d.ts +22 -0
  26. package/dist/TimeLimit.js +5 -0
  27. package/dist/TimeLimit.js.map +1 -1
  28. package/dist/Undo.d.ts +18 -0
  29. package/dist/Undo.js +6 -0
  30. package/dist/Undo.js.map +1 -1
  31. package/dist/UnpredictableMove.d.ts +19 -0
  32. package/dist/UnpredictableMove.js +5 -0
  33. package/dist/UnpredictableMove.js.map +1 -1
  34. package/dist/material/HiddenMaterialRules.d.ts +49 -1
  35. package/dist/material/HiddenMaterialRules.js +56 -13
  36. package/dist/material/HiddenMaterialRules.js.map +1 -1
  37. package/dist/material/MaterialGame.d.ts +12 -0
  38. package/dist/material/MaterialGameSetup.d.ts +74 -0
  39. package/dist/material/MaterialGameSetup.js +68 -5
  40. package/dist/material/MaterialGameSetup.js.map +1 -1
  41. package/dist/material/MaterialRules.d.ts +133 -1
  42. package/dist/material/MaterialRules.js +131 -5
  43. package/dist/material/MaterialRules.js.map +1 -1
  44. package/dist/material/SecretMaterialRules.d.ts +31 -0
  45. package/dist/material/SecretMaterialRules.js +23 -1
  46. package/dist/material/SecretMaterialRules.js.map +1 -1
  47. package/dist/material/items/Material.d.ts +265 -5
  48. package/dist/material/items/Material.js +266 -7
  49. package/dist/material/items/Material.js.map +1 -1
  50. package/dist/material/items/MaterialDeck.d.ts +34 -1
  51. package/dist/material/items/MaterialDeck.js +36 -3
  52. package/dist/material/items/MaterialDeck.js.map +1 -1
  53. package/dist/material/items/MaterialItem.d.ts +12 -0
  54. package/dist/material/items/MaterialMoney.d.ts +81 -0
  55. package/dist/material/items/MaterialMoney.js +288 -0
  56. package/dist/material/items/MaterialMoney.js.map +1 -0
  57. package/dist/material/items/MaterialMutator.d.ts +39 -0
  58. package/dist/material/items/MaterialMutator.js +44 -5
  59. package/dist/material/items/MaterialMutator.js.map +1 -1
  60. package/dist/material/items/index.d.ts +2 -1
  61. package/dist/material/items/index.js +3 -1
  62. package/dist/material/items/index.js.map +1 -1
  63. package/dist/material/location/Location.d.ts +28 -0
  64. package/dist/material/location/Location.js +5 -0
  65. package/dist/material/location/Location.js.map +1 -1
  66. package/dist/material/location/LocationBuilder.js +1 -1
  67. package/dist/material/location/strategy/FillGapStrategy.d.ts +4 -0
  68. package/dist/material/location/strategy/FillGapStrategy.js +5 -1
  69. package/dist/material/location/strategy/FillGapStrategy.js.map +1 -1
  70. package/dist/material/location/strategy/LocationStrategy.d.ts +20 -0
  71. package/dist/material/location/strategy/PositiveSequenceStrategy.d.ts +4 -0
  72. package/dist/material/location/strategy/PositiveSequenceStrategy.js +5 -1
  73. package/dist/material/location/strategy/PositiveSequenceStrategy.js.map +1 -1
  74. package/dist/material/memory/GameMemory.d.ts +21 -0
  75. package/dist/material/memory/GameMemory.js +22 -1
  76. package/dist/material/memory/GameMemory.js.map +1 -1
  77. package/dist/material/memory/PlayerMemory.d.ts +22 -0
  78. package/dist/material/memory/PlayerMemory.js +23 -1
  79. package/dist/material/memory/PlayerMemory.js.map +1 -1
  80. package/dist/material/moves/CustomMove.d.ts +18 -0
  81. package/dist/material/moves/CustomMove.js +13 -0
  82. package/dist/material/moves/CustomMove.js.map +1 -1
  83. package/dist/material/moves/MaterialMove.d.ts +9 -0
  84. package/dist/material/moves/MaterialMoveBuilder.d.ts +36 -0
  85. package/dist/material/moves/MaterialMoveBuilder.js +36 -0
  86. package/dist/material/moves/MaterialMoveBuilder.js.map +1 -1
  87. package/dist/material/moves/MoveKind.d.ts +3 -0
  88. package/dist/material/moves/MoveKind.js +3 -0
  89. package/dist/material/moves/MoveKind.js.map +1 -1
  90. package/dist/material/moves/items/CreateItem.d.ts +13 -0
  91. package/dist/material/moves/items/CreateItem.js +10 -0
  92. package/dist/material/moves/items/CreateItem.js.map +1 -1
  93. package/dist/material/moves/items/CreateItemsAtOnce.d.ts +14 -0
  94. package/dist/material/moves/items/CreateItemsAtOnce.js +10 -0
  95. package/dist/material/moves/items/CreateItemsAtOnce.js.map +1 -1
  96. package/dist/material/moves/items/DeleteItem.d.ts +18 -0
  97. package/dist/material/moves/items/DeleteItem.js +11 -0
  98. package/dist/material/moves/items/DeleteItem.js.map +1 -1
  99. package/dist/material/moves/items/DeleteItemsAtOnce.d.ts +17 -0
  100. package/dist/material/moves/items/DeleteItemsAtOnce.js +10 -0
  101. package/dist/material/moves/items/DeleteItemsAtOnce.js.map +1 -1
  102. package/dist/material/moves/items/ItemMove.d.ts +12 -0
  103. package/dist/material/moves/items/ItemMoveType.d.ts +3 -0
  104. package/dist/material/moves/items/ItemMoveType.js +3 -0
  105. package/dist/material/moves/items/ItemMoveType.js.map +1 -1
  106. package/dist/material/moves/items/MoveItem.d.ts +20 -0
  107. package/dist/material/moves/items/MoveItem.js +11 -0
  108. package/dist/material/moves/items/MoveItem.js.map +1 -1
  109. package/dist/material/moves/items/MoveItemsAtOnce.d.ts +20 -0
  110. package/dist/material/moves/items/MoveItemsAtOnce.js +10 -0
  111. package/dist/material/moves/items/MoveItemsAtOnce.js.map +1 -1
  112. package/dist/material/moves/items/RollItem.d.ts +19 -0
  113. package/dist/material/moves/items/RollItem.js +10 -0
  114. package/dist/material/moves/items/RollItem.js.map +1 -1
  115. package/dist/material/moves/items/SelectItem.d.ts +20 -0
  116. package/dist/material/moves/items/SelectItem.js +11 -0
  117. package/dist/material/moves/items/SelectItem.js.map +1 -1
  118. package/dist/material/moves/items/Shuffle.d.ts +26 -0
  119. package/dist/material/moves/items/Shuffle.js +15 -0
  120. package/dist/material/moves/items/Shuffle.js.map +1 -1
  121. package/dist/material/moves/local/CloseTutorialPopup.d.ts +8 -0
  122. package/dist/material/moves/local/CloseTutorialPopup.js +5 -0
  123. package/dist/material/moves/local/CloseTutorialPopup.js.map +1 -1
  124. package/dist/material/moves/local/DisplayHelp.d.ts +18 -0
  125. package/dist/material/moves/local/DisplayHelp.js +3 -0
  126. package/dist/material/moves/local/DisplayHelp.js.map +1 -1
  127. package/dist/material/moves/local/DropItem.d.ts +9 -0
  128. package/dist/material/moves/local/LocalMove.d.ts +6 -0
  129. package/dist/material/moves/local/LocalMove.js +3 -0
  130. package/dist/material/moves/local/LocalMove.js.map +1 -1
  131. package/dist/material/moves/local/SetTutorialStep.d.ts +8 -0
  132. package/dist/material/moves/local/SetTutorialStep.js +5 -0
  133. package/dist/material/moves/local/SetTutorialStep.js.map +1 -1
  134. package/dist/material/rules/MaterialRulesPart.d.ts +76 -0
  135. package/dist/material/rules/MaterialRulesPart.js +75 -3
  136. package/dist/material/rules/MaterialRulesPart.js.map +1 -1
  137. package/dist/material/rules/PlayerTurnRule.d.ts +19 -0
  138. package/dist/material/rules/PlayerTurnRule.js +20 -1
  139. package/dist/material/rules/PlayerTurnRule.js.map +1 -1
  140. package/dist/material/rules/RuleStep.d.ts +3 -0
  141. package/dist/material/rules/SimultaneousRule.d.ts +25 -0
  142. package/dist/material/rules/SimultaneousRule.js +21 -1
  143. package/dist/material/rules/SimultaneousRule.js.map +1 -1
  144. package/dist/material/tutorial/TutorialState.d.ts +7 -0
  145. package/dist/options/OptionsValidationError.js +1 -1
  146. package/dist/options/PlayerEnumOption.js +3 -0
  147. package/dist/options/PlayerEnumOption.js.map +1 -1
  148. package/dist/utils/action-view.util.js +3 -1
  149. package/dist/utils/action-view.util.js.map +1 -1
  150. package/dist/utils/action.util.js +1 -1
  151. package/dist/utils/action.util.js.map +1 -1
  152. package/dist/utils/enum.util.d.ts +27 -0
  153. package/dist/utils/enum.util.js +24 -0
  154. package/dist/utils/enum.util.js.map +1 -1
  155. package/dist/utils/grid.squares.util.d.ts +26 -0
  156. package/dist/utils/grid.squares.util.js +26 -0
  157. package/dist/utils/grid.squares.util.js.map +1 -1
  158. package/dist/utils/grid.util.d.ts +8 -0
  159. package/dist/utils/grid.util.js +5 -0
  160. package/dist/utils/grid.util.js.map +1 -1
  161. package/dist/utils/listing.util.d.ts +12 -0
  162. package/dist/utils/listing.util.js +12 -0
  163. package/dist/utils/listing.util.js.map +1 -1
  164. package/dist/utils/money.util.d.ts +42 -4
  165. package/dist/utils/money.util.js +39 -1
  166. package/dist/utils/money.util.js.map +1 -1
  167. package/dist/utils/random.util.d.ts +6 -2
  168. package/dist/utils/random.util.js +6 -10
  169. package/dist/utils/random.util.js.map +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialMoveBuilder.js","sourceRoot":"","sources":["../../../src/material/moves/MaterialMoveBuilder.ts"],"names":[],"mappings":";;;AAEA,iCAWgB;AAKhB,IAAiB,mBAAmB,CA4EnC;AA5ED,WAAiB,mBAAmB;IAKrB,mCAAe,GAAG,UAAuD,EAAK,EAAE,MAAS;QACpG,OAAA,CAAC,EAAE,IAAI,EAAE,gBAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAY,CAAC,eAAe,EAAE,E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are enum MoveKind {
2
5
  ItemMove = 1,
3
6
  RulesMove = 2,
@@ -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":";;;AAGA,IAAY,QAEX;AAFD,WAAY,QAAQ;IAClB,+CAAY,CAAA;IAAE,iDAAa,CAAA;IAAE,mDAAc,CAAA;IAAE,iDAAa,CAAA;AAC5D,CAAC,EAFW,QAAQ,wBAAR,QAAQ,QAEnB"}
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;AAetC,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;AAOD,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"}
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;AAgBtC,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;AAOD,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
+ {"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;AAoBtC,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;AAQD,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
+ {"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;AAmB7C,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;AAOD,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
+ {"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,3 +1,6 @@
1
+ /**
2
+ * The different types of {@link ItemMove}
3
+ */
1
4
  export declare enum ItemMoveType {
2
5
  Create = 0,
3
6
  Move = 1,
@@ -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":";;;AAGA,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"}
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;AAyB7C,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;AAQD,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"}
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;AAyB7C,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;AAOD,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"}
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;AAsB7C,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;AAOD,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
+ {"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"}
@@ -1,11 +1,31 @@
1
1
  import { MaterialMove } from '../MaterialMove';
2
2
  import { MaterialMoveCommon } from './ItemMove';
3
3
  import { ItemMoveType } from './ItemMoveType';
4
+ /**
5
+ * Move object that will select one {@link MaterialItem} (or a part of its quantity), when played.
6
+ * Use {@link Material} utility to build the move easily.
7
+ * The same object is used to unselect an item.
8
+ *
9
+ * @property itemIndex index of the item to move
10
+ * @property quantity if provided, move the specified quantity from the item (split in two items). Otherwise, move all the item.
11
+ * @property selected False to unselect
12
+ */
4
13
  export type SelectItem<MaterialType extends number = number> = MaterialMoveCommon<MaterialType> & {
5
14
  type: typeof ItemMoveType.Select;
6
15
  itemIndex: number;
7
16
  quantity?: number;
8
17
  selected?: boolean;
9
18
  };
19
+ /**
20
+ * Type guard to test if a {@link MaterialMove} is a {@link SelectItem} move
21
+ * @param move Move to test
22
+ * @returns true if move is a {@link SelectItem}
23
+ */
10
24
  export declare function isSelectItem<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is SelectItem<M>;
25
+ /**
26
+ * Function to get a type guard for a {@link SelectItem} move for specific item types.
27
+ * @param type Item type to test
28
+ * @param index Optional itemIndex to test along the item type
29
+ * @returns a type guard similar as {@link isSelectItem} but that also verify the item type.
30
+ */
11
31
  export declare function isSelectItemType<P extends number, M extends number, L extends number>(type: M, index?: number): (move: MaterialMove<P, M, L>) => move is SelectItem<M>;
@@ -3,10 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isSelectItemType = exports.isSelectItem = 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 SelectItem} move
8
+ * @param move Move to test
9
+ * @returns true if move is a {@link SelectItem}
10
+ */
6
11
  function isSelectItem(move) {
7
12
  return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Select;
8
13
  }
9
14
  exports.isSelectItem = isSelectItem;
15
+ /**
16
+ * Function to get a type guard for a {@link SelectItem} 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 isSelectItem} but that also verify the item type.
20
+ */
10
21
  function isSelectItemType(type, index) {
11
22
  return function (move) {
12
23
  return isSelectItem(move) && move.itemType === type && (index === undefined || move.itemIndex === index);
@@ -1 +1 @@
1
- {"version":3,"file":"SelectItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/SelectItem.ts"],"names":[],"mappings":";;;AACA,wCAAsC;AAEtC,+CAA6C;AAuB7C,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;AAQD,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
+ {"version":3,"file":"SelectItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/SelectItem.ts"],"names":[],"mappings":";;;AACA,wCAAsC;AAEtC,+CAA6C;AAkB7C;;;;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,13 +1,39 @@
1
1
  import { ItemMoveType } from './ItemMoveType';
2
2
  import { MaterialMoveCommon } from './ItemMove';
3
3
  import { MaterialMove } from '../MaterialMove';
4
+ /**
5
+ * Move object that will shuffle a list of {@link MaterialItem}, when played.
6
+ * Use {@link Material} utility to build the move easily.
7
+ * When items are shuffled, they swap their indexes randomly so that players can never "track" one item in the list.
8
+ *
9
+ * @property indexes indexes of the items to shuffle
10
+ */
4
11
  export type Shuffle<MaterialType extends number = number> = MaterialMoveCommon<MaterialType> & {
5
12
  type: typeof ItemMoveType.Shuffle;
6
13
  indexes: number[];
7
14
  };
15
+ /**
16
+ * Data structure when a {@link Shuffle} move has been randomized.
17
+ * @property newIndexes The new random indexes
18
+ */
8
19
  export type ShuffleRandomized<MaterialType extends number = number> = Shuffle<MaterialType> & {
9
20
  newIndexes: number[];
10
21
  };
22
+ /**
23
+ * Type guard to test if a {@link MaterialMove} is a {@link Shuffle} move
24
+ * @param move Move to test
25
+ * @returns true if move is a {@link Shuffle}
26
+ */
11
27
  export declare function isShuffle<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is Shuffle<M>;
28
+ /**
29
+ * Function to get a type guard for a {@link Shuffle} move for specific item types.
30
+ * @param type Item type to test
31
+ * @returns a type guard similar as {@link isShuffle} but that also verify the item type.
32
+ */
12
33
  export declare function isShuffleItemType<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is Shuffle<M>;
34
+ /**
35
+ * Type guard to test if a {@link MaterialMove} is a {@link ShuffleRandomized} move
36
+ * @param move Move to test
37
+ * @returns true if move is a {@link ShuffleRandomized}
38
+ */
13
39
  export declare function isShuffleRandomized<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is ShuffleRandomized<M>;
@@ -3,16 +3,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isShuffleRandomized = exports.isShuffleItemType = exports.isShuffle = 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 Shuffle} move
8
+ * @param move Move to test
9
+ * @returns true if move is a {@link Shuffle}
10
+ */
6
11
  function isShuffle(move) {
7
12
  return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Shuffle;
8
13
  }
9
14
  exports.isShuffle = isShuffle;
15
+ /**
16
+ * Function to get a type guard for a {@link Shuffle} move for specific item types.
17
+ * @param type Item type to test
18
+ * @returns a type guard similar as {@link isShuffle} but that also verify the item type.
19
+ */
10
20
  function isShuffleItemType(type) {
11
21
  return function (move) {
12
22
  return isShuffle(move) && move.itemType === type;
13
23
  };
14
24
  }
15
25
  exports.isShuffleItemType = isShuffleItemType;
26
+ /**
27
+ * Type guard to test if a {@link MaterialMove} is a {@link ShuffleRandomized} move
28
+ * @param move Move to test
29
+ * @returns true if move is a {@link ShuffleRandomized}
30
+ */
16
31
  function isShuffleRandomized(move) {
17
32
  return isShuffle(move) && Array.isArray(move.newIndexes);
18
33
  }