@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
@@ -33,35 +33,83 @@ exports.MaterialRules = void 0;
33
33
  var random_1 = __importDefault(require("lodash/random"));
34
34
  var shuffle_1 = __importDefault(require("lodash/shuffle"));
35
35
  var Rules_1 = require("../Rules");
36
+ var TimeLimit_1 = require("../TimeLimit");
36
37
  var items_1 = require("./items");
37
38
  var memory_1 = require("./memory");
38
39
  var moves_1 = require("./moves");
39
40
  var rules_1 = require("./rules");
40
- var MaterialRules = (function (_super) {
41
+ /**
42
+ * The MaterialRules class is the main class to implement the rules of a board game with the "Material oriented" approach.
43
+ * With this approach, the game state and the game moves is structured around the game material items and their movements.
44
+ * The rules are also automatically split into small parts.
45
+ * Finally, a "memory" util is available to store temporary information which is not part of the material or the rules state.
46
+ * If you need to implement game with hidden information, see {@link HiddenMaterialRules} or {@link SecretMaterialRules}.
47
+ *
48
+ * @typeparam Player - identifier of a player. Either a number or a numeric enum (eg: PlayerColor)
49
+ * @typeparam MaterialType - Numeric enum of the types of material manipulated in the game
50
+ * @typeparam LocationType - Numeric enum of the types of location in the game where the material can be located
51
+ */
52
+ var MaterialRules = /** @class */ (function (_super) {
41
53
  __extends(MaterialRules, _super);
42
54
  function MaterialRules() {
43
55
  var _this = _super !== null && _super.apply(this, arguments) || this;
56
+ /**
57
+ * The "location strategies" are global rules that always apply in a game when we want to maintain a consistency in the position of the material.
58
+ * For example, we usually want the cards in a player hand to always go from x=0 to x=n without a gap, so we use a {@link PositiveSequenceStrategy} to enforce
59
+ * the rule once and for all. If we want to create a "river" of card we can use a {@link FillGapStrategy}.
60
+ * Games with more complex use cases can implement their own {@link LocationStrategy}.
61
+ */
44
62
  _this.locationsStrategies = {};
45
63
  return _this;
46
64
  }
65
+ /**
66
+ * Helper function to manipulate the material items of the game. See {@link Material}.
67
+ *
68
+ * @param type The type of Material we want to work on
69
+ * @returns a Material instance to manipulate all the material of that type in current game state.
70
+ */
47
71
  MaterialRules.prototype.material = function (type) {
48
- var _a;
49
- return new items_1.Material(type, Array.from(((_a = this.game.items[type]) !== null && _a !== void 0 ? _a : []).entries()).filter(function (entry) { return entry[1].quantity !== 0; }));
72
+ return new items_1.Material(type, this.game.items[type]);
50
73
  };
51
74
  Object.defineProperty(MaterialRules.prototype, "players", {
75
+ /**
76
+ * Shortcut for this.game.players
77
+ * @returns array of the players identifiers
78
+ */
52
79
  get: function () {
53
80
  return this.game.players;
54
81
  },
55
82
  enumerable: false,
56
83
  configurable: true
57
84
  });
85
+ /**
86
+ * Utility function to access the memory tool for the game or on player.
87
+ * this.game.memory can be used to store any data that is not available through the state of the material, or current rule.
88
+ *
89
+ * @param player Optional, identifier of the player if we want to manipulate a specific player's memory
90
+ * @returns {@link GameMemory} or {@link PlayerMemory} utility
91
+ * @protected
92
+ */
58
93
  MaterialRules.prototype.getMemory = function (player) {
59
94
  return player === undefined ? new memory_1.GameMemory(this.game) : new memory_1.PlayerMemory(this.game, player);
60
95
  };
96
+ /**
97
+ * Retrieve the value memorized under a given key.
98
+ * Shortcut for this.game.memory[key] or this.game.memory[key][player]
99
+ *
100
+ * @param key Key under which the memory is store. Usually a value of a numeric enum named "Memory".
101
+ * @param player optional, if we need to memorize a different value for each player.
102
+ */
61
103
  MaterialRules.prototype.remind = function (key, player) {
62
104
  return this.getMemory(player).remind(key);
63
105
  };
64
106
  Object.defineProperty(MaterialRules.prototype, "rulesStep", {
107
+ /**
108
+ * Instantiates the class that handled the rules of the game corresponding to the current rule id.
109
+ * This function reads the current value in this.game.rule.id and instantiate the corresponding class in the {@link rules} property.
110
+ *
111
+ * @returns the class that handled the rules of the game, at current specific game state.
112
+ */
65
113
  get: function () {
66
114
  if (!this.game.rule)
67
115
  return;
@@ -75,16 +123,40 @@ var MaterialRules = (function (_super) {
75
123
  enumerable: false,
76
124
  configurable: true
77
125
  });
126
+ /**
127
+ * Returns a utility class to change the state of the items.
128
+ * Used by the framework to apply the Material moves on the items (should not be manipulated directly in the games).
129
+ *
130
+ * @param type MaterialType of the item we want to modify
131
+ * @returns a MaterialMutator to change the state of the items
132
+ */
78
133
  MaterialRules.prototype.mutator = function (type) {
79
- var _a;
80
- return new items_1.MaterialMutator(type, (_a = this.game.items[type]) !== null && _a !== void 0 ? _a : [], this.locationsStrategies[type], this.itemsCanMerge(type));
134
+ if (!this.game.items[type])
135
+ this.game.items[type] = [];
136
+ return new items_1.MaterialMutator(type, this.game.items[type], this.locationsStrategies[type], this.itemsCanMerge(type));
81
137
  };
138
+ /**
139
+ * Items can sometime be stored with a quantity (for example, coins).
140
+ * By default, if you create or move similar items to the exact same location, they will merge into one item with a quantity.
141
+ * However, if you have 2 cards that can be at the same spot for a short time (swapping or replacing), you can override this function to prevent them to merge
142
+ *
143
+ * @param _type type of items
144
+ * @returns true if items can merge into one item with a quantity (default behavior)
145
+ */
82
146
  MaterialRules.prototype.itemsCanMerge = function (_type) {
83
147
  return true;
84
148
  };
149
+ /**
150
+ * In the material approach, the rules behavior is delegated to the current {@link rulesStep}. See {@link Rules.delegate}
151
+ */
85
152
  MaterialRules.prototype.delegate = function () {
86
153
  return this.rulesStep;
87
154
  };
155
+ /**
156
+ * Randomize Shuffle of Roll moves (see {@link RandomMove.randomize})
157
+ * @param move The Material Move to randomize
158
+ * @returns the randomized move
159
+ */
88
160
  MaterialRules.prototype.randomize = function (move) {
89
161
  if ((0, moves_1.isShuffle)(move)) {
90
162
  return __assign(__assign({}, move), { newIndexes: (0, shuffle_1.default)(move.indexes) });
@@ -94,9 +166,24 @@ var MaterialRules = (function (_super) {
94
166
  }
95
167
  return move;
96
168
  };
169
+ /**
170
+ * When a RollItem move is create, it has to be randomized on the server side before it is saved and shared.
171
+ * This function provides the random value. By default, it returns a value between 0 and 5 assuming a 6 sided dice is rolled.
172
+ * If you need to flip a coin or roll non-cubic dice, you need to override this function.
173
+ *
174
+ * @param _move The RollItem move to randomize
175
+ * @returns a random rolled value, by default a value between 0 and 5 (cubic dice result)
176
+ */
97
177
  MaterialRules.prototype.roll = function (_move) {
98
178
  return (0, random_1.default)(5);
99
179
  };
180
+ /**
181
+ * Execution of the Material Moves. See {@link Rules.play}.
182
+ *
183
+ * @param move Material move to play on the game state
184
+ * @param context Context in which the move was played
185
+ * @returns Consequences of the move
186
+ */
100
187
  MaterialRules.prototype.play = function (move, context) {
101
188
  var _a, _b;
102
189
  var consequences = [];
@@ -181,6 +268,14 @@ var MaterialRules = (function (_super) {
181
268
  }
182
269
  return moves.concat((_f = (_e = this.rulesStep) === null || _e === void 0 ? void 0 : _e.onRuleStart(move, rule, context)) !== null && _f !== void 0 ? _f : []);
183
270
  };
271
+ /**
272
+ * By default, a Material Move can be undone if no player became active and no dice was rolled.
273
+ * See {@link Undo.canUndo} and {@link HiddenMaterialRules.canUndo}
274
+ *
275
+ * @param action Action to consider
276
+ * @param consecutiveActions Action played in between
277
+ * @returns true if the action can be undone by the player that played it
278
+ */
184
279
  MaterialRules.prototype.canUndo = function (action, consecutiveActions) {
185
280
  for (var i = consecutiveActions.length - 1; i >= 0; i--) {
186
281
  if (this.consecutiveActionBlocksUndo(action, consecutiveActions[i])) {
@@ -216,18 +311,49 @@ var MaterialRules = (function (_super) {
216
311
  }
217
312
  return this.moveActivatesPlayer(action.move);
218
313
  };
314
+ /**
315
+ * @protected
316
+ * If a moves blocks the undo, any action with this move cannot be undone.
317
+ * By default, a move block the undo if it activates a player or exposes new information (roll result, hidden information revealed...)
318
+ *
319
+ * @param move The move to consider
320
+ * @returns true if the move blocks the undo
321
+ */
219
322
  MaterialRules.prototype.moveBlocksUndo = function (move) {
220
323
  return this.moveActivatesPlayer(move) || (0, moves_1.isRoll)(move);
221
324
  };
222
325
  MaterialRules.prototype.moveActivatesPlayer = function (move) {
223
326
  return (0, moves_1.isStartPlayerTurn)(move) || (0, moves_1.isStartSimultaneousRule)(move);
224
327
  };
328
+ /**
329
+ * Random moves, or moves that reveals something to me, are unpredictable.
330
+ * Unpredictable moves cannot be precomputed on client side, the server side's response is necessary.
331
+ * See {@link Rules.isUnpredictableMove}
332
+ *
333
+ * @param move Material move to consider
334
+ * @param _player The player playing the move
335
+ * @returns true if the move outcome cannot be predicted on client side
336
+ */
225
337
  MaterialRules.prototype.isUnpredictableMove = function (move, _player) {
226
338
  return (0, moves_1.isRoll)(move);
227
339
  };
340
+ /**
341
+ * A Material Game is over when there is no rule left to execute. This state results of a {@link EndGame} move.
342
+ *
343
+ * @returns true if game is over
344
+ */
228
345
  MaterialRules.prototype.isOver = function () {
229
346
  return !this.game.rule;
230
347
  };
348
+ /**
349
+ * Amount of time given to a player everytime it is their turn to play.
350
+ * @param playerId Id of the player, if you want to give different time depending on the id for asymmetric games.
351
+ * @return number of seconds to add to the player's clock
352
+ */
353
+ MaterialRules.prototype.giveTime = function (playerId) {
354
+ var rule = this.rulesStep;
355
+ return rule && (0, TimeLimit_1.hasTimeLimit)(rule) ? rule.giveTime(playerId) : 60;
356
+ };
231
357
  return MaterialRules;
232
358
  }(Rules_1.Rules));
233
359
  exports.MaterialRules = MaterialRules;
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialRules.js","sourceRoot":"","sources":["../../src/material/MaterialRules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAkC;AAClC,2DAAoC;AAGpC,kCAAiD;AAGjD,iCAAmD;AAGnD,mCAAmD;AACnD,iCAgBgB;AAChB,iCAAyF;AAazF;IACU,iCAAiH;IAD3H;;QAqBW,yBAAmB,GAAuH,EAAE,CAAA;;IAuSvJ,CAAC;IA/RC,gCAAQ,GAAR,UAAS,IAAkB;;QACzB,OAAO,IAAI,gBAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,EAAvB,CAAuB,CAAC,CAAC,CAAA;IACzH,CAAC;IAMD,sBAAI,kCAAO;aAAX;YACE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;QAC1B,CAAC;;;OAAA;IAUS,iCAAS,GAAnB,UAAoB,MAAe;QACjC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,mBAAU,CAAS,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,qBAAY,CAAS,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC/G,CAAC;IASD,8BAAM,GAAN,U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OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;IAED;;;;;;;OAOG;IACO,sCAAc,GAAxB,UAAyB,IAAsD;QAC7E,OAAO,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAA,cAAM,EAAC,IAAI,CAAC,CAAA;IACvD,CAAC;IAEO,2CAAmB,GAA3B,UAA4B,IAAsD;QAChF,OAAO,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAAI,IAAA,+BAAuB,EAAC,IAAI,CAAC,CAAA;IACjE,CAAC;IAED;;;;;;;;OAQG;IACH,2CAAmB,GAAnB,UAAoB,IAAsD,EAAE,OAAe;QACzF,OAAO,IAAA,cAAM,EAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IAED;;;;OAIG;IACH,8BAAM,GAAN;QACE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;IACxB,CAAC;IAED;;;;OAIG;IACH,gCAAQ,GAAR,UAAS,QAAgB;QACvB,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAA;QAC3B,OAAO,IAAI,IAAI,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAClE,CAAC;IACH,oBAAC;AAAD,CAAC,AAvUD,CACU,aAAK,GAsUd;AAvUqB,sCAAa"}
@@ -3,11 +3,42 @@ import { HiddenMaterialRules, HidingStrategy } from './HiddenMaterialRules';
3
3
  import { MaterialItem } from './items';
4
4
  import { MaterialGame } from './MaterialGame';
5
5
  import { MaterialMove, MaterialMoveRandomized } from './moves';
6
+ /**
7
+ * Implement SecretMaterialRules when you want to use the {@link MaterialRules} approach with {@link SecretInformation}.
8
+ * Using some {@link HidingSecretsStrategy} allows to enforce the security of a game with secret information easily.
9
+ * If the game has only hidden information (all players have the same information), then you must implement {@link HiddenMaterialRules} instead.
10
+ */
6
11
  export declare abstract class SecretMaterialRules<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> extends HiddenMaterialRules<Player, MaterialType, LocationType> implements SecretInformation<MaterialGame, MaterialMove<Player, MaterialType, LocationType>, MaterialMove<Player, MaterialType, LocationType>, Player> {
12
+ /**
13
+ * Link {@link HiddenMaterialRules.hidingStrategies}, but with knowledge of whom the item should be hidden from.
14
+ * See {@link HidingSecretsStrategy}
15
+ */
7
16
  abstract hidingStrategies: Partial<Record<MaterialType, Partial<Record<LocationType, HidingSecretsStrategy<Player, LocationType>>>>>;
17
+ /**
18
+ * With the material approach, we can offer a default working implementation for {@link SecretInformation.getPlayerView}
19
+ */
8
20
  getPlayerView(player: Player): MaterialGame<Player, MaterialType, LocationType>;
21
+ /**
22
+ * With the material approach, we can offer a default working implementation for {@link SecretInformation.getPlayerMoveView}
23
+ */
9
24
  getPlayerMoveView(move: MaterialMoveRandomized<Player, MaterialType, LocationType>, player: Player): MaterialMove<Player, MaterialType, LocationType>;
10
25
  }
26
+ /**
27
+ * A Hiding Strategy is a function that takes an item and a player and returns a list of path to hide in the item object.
28
+ * If the player parameter is undefined, the function must return the information to hide from the spectators.
29
+ * See {@link hideItemIdToOthers} and {@link hideFrontToOthers} for 2 HidingSecretsStrategy frequently used.
30
+ */
11
31
  export type HidingSecretsStrategy<P extends number = number, L extends number = number> = (item: MaterialItem<P, L>, player?: P) => string[];
32
+ /**
33
+ * Hide the item id to all players except the player that is equal to item.location.player.
34
+ * Used to hide cards in a player's hand from others for instance.
35
+ * @param item The item to hide information from
36
+ * @param player The player to hide information to (or the spectator)
37
+ */
12
38
  export declare const hideItemIdToOthers: <P extends number = number, L extends number = number>(item: MaterialItem<P, L>, player?: P) => string[];
39
+ /**
40
+ * Hide the item.id.front to all players except the player that is equal to item.location.player.
41
+ * @param item The item to hide information from
42
+ * @param player The player to hide information to (or the spectator)
43
+ */
13
44
  export declare const hideFrontToOthers: HidingStrategy;
@@ -17,22 +17,44 @@ var __extends = (this && this.__extends) || (function () {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.hideFrontToOthers = exports.hideItemIdToOthers = exports.SecretMaterialRules = void 0;
19
19
  var HiddenMaterialRules_1 = require("./HiddenMaterialRules");
20
- var SecretMaterialRules = (function (_super) {
20
+ /**
21
+ * Implement SecretMaterialRules when you want to use the {@link MaterialRules} approach with {@link SecretInformation}.
22
+ * Using some {@link HidingSecretsStrategy} allows to enforce the security of a game with secret information easily.
23
+ * If the game has only hidden information (all players have the same information), then you must implement {@link HiddenMaterialRules} instead.
24
+ */
25
+ var SecretMaterialRules = /** @class */ (function (_super) {
21
26
  __extends(SecretMaterialRules, _super);
22
27
  function SecretMaterialRules() {
23
28
  return _super !== null && _super.apply(this, arguments) || this;
24
29
  }
30
+ /**
31
+ * With the material approach, we can offer a default working implementation for {@link SecretInformation.getPlayerView}
32
+ */
25
33
  SecretMaterialRules.prototype.getPlayerView = function (player) {
26
34
  return this.getView(player);
27
35
  };
36
+ /**
37
+ * With the material approach, we can offer a default working implementation for {@link SecretInformation.getPlayerMoveView}
38
+ */
28
39
  SecretMaterialRules.prototype.getPlayerMoveView = function (move, player) {
29
40
  return this.getMoveView(move, player);
30
41
  };
31
42
  return SecretMaterialRules;
32
43
  }(HiddenMaterialRules_1.HiddenMaterialRules));
33
44
  exports.SecretMaterialRules = SecretMaterialRules;
45
+ /**
46
+ * Hide the item id to all players except the player that is equal to item.location.player.
47
+ * Used to hide cards in a player's hand from others for instance.
48
+ * @param item The item to hide information from
49
+ * @param player The player to hide information to (or the spectator)
50
+ */
34
51
  var hideItemIdToOthers = function (item, player) { return item.location.player === player ? [] : ['id']; };
35
52
  exports.hideItemIdToOthers = hideItemIdToOthers;
53
+ /**
54
+ * Hide the item.id.front to all players except the player that is equal to item.location.player.
55
+ * @param item The item to hide information from
56
+ * @param player The player to hide information to (or the spectator)
57
+ */
36
58
  var hideFrontToOthers = function (item, player) { return item.location.player === player ? [] : ['id.front']; };
37
59
  exports.hideFrontToOthers = hideFrontToOthers;
38
60
  //# sourceMappingURL=SecretMaterialRules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SecretMaterialRules.js","sourceRoot":"","sources":["../../src/material/SecretMaterialRules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6DAA2E;AAU3E;IACU,uCAAuD;IADjE;;IAuBA,CAAC;IAVC,2CAAa,GAAb,UAAc,MAAc;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAKD,+CAAiB,GAAjB,UAAkB,IAAgE,EAAE,MAAc;QAChG,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACvC,CAAC;IACH,0BAAC;AAAD,CAAC,AAvBD,CACU,yCAAmB,GAsB5B;AAvBqB,kDAAmB;AAsClC,IAAM,kBAAkB,GAAG,UAChC,IAAwB,EAAE,MAAU,IACvB,OAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAA7C,CAA6C,CAAA;AAF/C,QAAA,kBAAkB,sBAE6B;AAOrD,IAAM,iBAAiB,GAAmB,UAC/C,IAAwB,EAAE,MAAU,IACvB,OAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,EAAnD,CAAmD,CAAA;AAFrD,QAAA,iBAAiB,qBAEoC"}
1
+ {"version":3,"file":"SecretMaterialRules.js","sourceRoot":"","sources":["../../src/material/SecretMaterialRules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6DAA2E;AAK3E;;;;GAIG;AACH;IACU,uCAAuD;IADjE;;IAuBA,CAAC;IAbC;;OAEG;IACH,2CAAa,GAAb,UAA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