@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.
- 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 +20 -2
- 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 +49 -1
- package/dist/material/HiddenMaterialRules.js +56 -13
- 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 +68 -5
- package/dist/material/MaterialGameSetup.js.map +1 -1
- package/dist/material/MaterialRules.d.ts +133 -1
- package/dist/material/MaterialRules.js +131 -5
- 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 +265 -5
- package/dist/material/items/Material.js +266 -7
- package/dist/material/items/Material.js.map +1 -1
- package/dist/material/items/MaterialDeck.d.ts +34 -1
- package/dist/material/items/MaterialDeck.js +36 -3
- package/dist/material/items/MaterialDeck.js.map +1 -1
- package/dist/material/items/MaterialItem.d.ts +12 -0
- package/dist/material/items/MaterialMoney.d.ts +81 -0
- package/dist/material/items/MaterialMoney.js +288 -0
- package/dist/material/items/MaterialMoney.js.map +1 -0
- package/dist/material/items/MaterialMutator.d.ts +39 -0
- package/dist/material/items/MaterialMutator.js +44 -5
- package/dist/material/items/MaterialMutator.js.map +1 -1
- package/dist/material/items/index.d.ts +2 -1
- package/dist/material/items/index.js +3 -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 +75 -3
- 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 +3 -1
- package/dist/utils/action-view.util.js.map +1 -1
- package/dist/utils/action.util.js +1 -1
- package/dist/utils/action.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 +42 -4
- package/dist/utils/money.util.js +39 -1
- package/dist/utils/money.util.js.map +1 -1
- package/dist/utils/random.util.d.ts +6 -2
- package/dist/utils/random.util.js +6 -10
- package/dist/utils/random.util.js.map +1 -1
- package/package.json +1 -1
|
@@ -32,21 +32,61 @@ var minBy_1 = __importDefault(require("lodash/minBy"));
|
|
|
32
32
|
var orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
33
33
|
var sumBy_1 = __importDefault(require("lodash/sumBy"));
|
|
34
34
|
var moves_1 = require("../moves");
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
var index_1 = require("./index");
|
|
36
|
+
/**
|
|
37
|
+
* The Material class is the core helper class that help manipulate the game items in a simple way.
|
|
38
|
+
* It includes two kind of functions: functions to filter items, and functions to build {@link ItemMove} objects.
|
|
39
|
+
* Filter function will all return a new instance of Material with only the filtered items. This class is designed to be immutable.
|
|
40
|
+
*
|
|
41
|
+
* @typeparam P - identifier of a player. Either a number or a numeric enum (eg: PlayerColor)
|
|
42
|
+
* @typeparam M - Numeric enum of the types of material manipulated in the game
|
|
43
|
+
* @typeparam L - Numeric enum of the types of location in the game where the material can be located
|
|
44
|
+
*/
|
|
45
|
+
var Material = /** @class */ (function () {
|
|
46
|
+
/**
|
|
47
|
+
* Construct a new Material helper instance
|
|
48
|
+
* @param {number} type Type of items this instance will work on
|
|
49
|
+
* @param {MaterialItem[]} items The complete list of items of this type in current game state.
|
|
50
|
+
* @param {function} processMove if provided, this function will be executed on every move created with this instance
|
|
51
|
+
* @param {ItemEntry[]} entries The list of items to work on. Each entry consists of an array with the index of the item, and the item
|
|
52
|
+
*/
|
|
53
|
+
function Material(type, items, processMove, entries) {
|
|
54
|
+
if (items === void 0) { items = []; }
|
|
55
|
+
if (entries === void 0) { entries = Array.from(items.entries()).filter(function (entry) { return entry[1].quantity !== 0; }); }
|
|
38
56
|
this.type = type;
|
|
39
|
-
this.
|
|
57
|
+
this.items = items;
|
|
40
58
|
this.processMove = processMove;
|
|
59
|
+
this.entries = entries;
|
|
41
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Helper function to return a new instance of the same class (works also for children class)
|
|
63
|
+
* @param {ItemEntry[]} entries Filtered entries for the new class
|
|
64
|
+
* @returns {this} the new Material instance
|
|
65
|
+
* @protected
|
|
66
|
+
*/
|
|
42
67
|
Material.prototype.new = function (entries) {
|
|
43
68
|
var Class = this.constructor;
|
|
44
|
-
return new Class(this.type,
|
|
45
|
-
};
|
|
69
|
+
return new Class(this.type, this.items, this.processMove, entries);
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Use this function to collect all the items in the current Material instance.
|
|
73
|
+
* For example, you can filter then collect the matching items: this.material(type).location(locationType).getItems()
|
|
74
|
+
*
|
|
75
|
+
* @typeparam Id - Identifier of the items (item.id)
|
|
76
|
+
* @param {function} predicate If provided, only the items matching the predicate will be returned
|
|
77
|
+
* @returns {MaterialItem[]} the items in this Material instance
|
|
78
|
+
*/
|
|
46
79
|
Material.prototype.getItems = function (predicate) {
|
|
47
80
|
var items = this.entries.map(function (entry) { return entry[1]; });
|
|
48
81
|
return predicate ? items.filter(predicate) : items;
|
|
49
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Use this function to collect this first item in the current Material instance.
|
|
85
|
+
* You can use {@link sort} to sort the items first.
|
|
86
|
+
*
|
|
87
|
+
* @param {number | function} arg Index of the item, or predicate function
|
|
88
|
+
* @returns {MaterialItem | undefined} the item, or undefined if none match
|
|
89
|
+
*/
|
|
50
90
|
Material.prototype.getItem = function (arg) {
|
|
51
91
|
if (typeof arg === 'number') {
|
|
52
92
|
var entry = this.entries.find(function (entry) { return entry[0] === arg; });
|
|
@@ -65,13 +105,23 @@ var Material = (function () {
|
|
|
65
105
|
return this.entries.length ? this.entries[0][1] : undefined;
|
|
66
106
|
}
|
|
67
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* @returns {number} index of the first item
|
|
110
|
+
*/
|
|
68
111
|
Material.prototype.getIndex = function () {
|
|
69
112
|
var _a, _b;
|
|
70
113
|
return (_b = (_a = this.entries[0]) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : -1;
|
|
71
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* @returns {number[]} indexes of the items
|
|
117
|
+
*/
|
|
72
118
|
Material.prototype.getIndexes = function () {
|
|
73
119
|
return this.entries.map(function (entry) { return entry[0]; });
|
|
74
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* Filter and return a new instance with only the items that match a specific index, or a specific index predicate
|
|
123
|
+
* @param {number | function} arg The index to keep, or the predicate matching the indexes to keep
|
|
124
|
+
*/
|
|
75
125
|
Material.prototype.index = function (arg) {
|
|
76
126
|
switch (typeof arg) {
|
|
77
127
|
case 'function':
|
|
@@ -92,6 +142,9 @@ var Material = (function () {
|
|
|
92
142
|
return this.new(items);
|
|
93
143
|
}
|
|
94
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* @deprecated Use {@link index} instead
|
|
147
|
+
*/
|
|
95
148
|
Material.prototype.indexes = function (indexes) {
|
|
96
149
|
var items = this.entries.filter(function (_a) {
|
|
97
150
|
var i = _a[0];
|
|
@@ -100,12 +153,18 @@ var Material = (function () {
|
|
|
100
153
|
return this.new(items);
|
|
101
154
|
};
|
|
102
155
|
Object.defineProperty(Material.prototype, "length", {
|
|
156
|
+
/**
|
|
157
|
+
* @returns {number} number of items
|
|
158
|
+
*/
|
|
103
159
|
get: function () {
|
|
104
160
|
return this.entries.length;
|
|
105
161
|
},
|
|
106
162
|
enumerable: false,
|
|
107
163
|
configurable: true
|
|
108
164
|
});
|
|
165
|
+
/**
|
|
166
|
+
* @returns {number} Sum of the quantity of all items
|
|
167
|
+
*/
|
|
109
168
|
Material.prototype.getQuantity = function () {
|
|
110
169
|
return (0, sumBy_1.default)(this.entries, function (_a) {
|
|
111
170
|
var _b;
|
|
@@ -113,60 +172,131 @@ var Material = (function () {
|
|
|
113
172
|
return (_b = item.quantity) !== null && _b !== void 0 ? _b : 1;
|
|
114
173
|
});
|
|
115
174
|
};
|
|
175
|
+
/**
|
|
176
|
+
* This function filter the items and returns a new instance with only the filtered items.
|
|
177
|
+
* This function is the top level filtering function, but other function can be used to simplify the code:
|
|
178
|
+
* {@link player}, {@link location}, {@link rotation}, {@link id}, {@link locationId}...
|
|
179
|
+
*
|
|
180
|
+
* @param {function} predicate The predicate function. Takes every item and index, and keep the item if it returns true
|
|
181
|
+
* @returns {this} New instance with only the items that match the predicate
|
|
182
|
+
*/
|
|
116
183
|
Material.prototype.filter = function (predicate) {
|
|
117
184
|
return this.new(this.entries.filter(function (_a) {
|
|
118
185
|
var index = _a[0], item = _a[1];
|
|
119
186
|
return predicate(item, index);
|
|
120
187
|
}));
|
|
121
188
|
};
|
|
189
|
+
/**
|
|
190
|
+
* Filters the items based on their ids.
|
|
191
|
+
*
|
|
192
|
+
* @param {function | string | number | Record} arg Id to keep, or predicate function to match the ids of the items to keep
|
|
193
|
+
* @returns {this} New instance with only the items which ids match the argument
|
|
194
|
+
*/
|
|
122
195
|
Material.prototype.id = function (arg) {
|
|
123
196
|
return this.filter(function (_a) {
|
|
124
197
|
var id = _a.id;
|
|
125
198
|
return typeof arg === 'function' ? arg(id) : (0, isEqual_1.default)(id, arg);
|
|
126
199
|
});
|
|
127
200
|
};
|
|
201
|
+
/**
|
|
202
|
+
* Filters the items based on their location type, or their location.
|
|
203
|
+
*
|
|
204
|
+
* @param {function | number} arg Location type to keep, or predicate function to match the location of the items to keep
|
|
205
|
+
* @returns {this} New instance with only the items which locations match the argument
|
|
206
|
+
*/
|
|
128
207
|
Material.prototype.location = function (arg) {
|
|
129
208
|
return this.filter(function (_a) {
|
|
130
209
|
var location = _a.location;
|
|
131
210
|
return typeof arg === 'function' ? arg(location) : location.type === arg;
|
|
132
211
|
});
|
|
133
212
|
};
|
|
213
|
+
/**
|
|
214
|
+
* Filters the items based on their rotation (item.location.rotation)
|
|
215
|
+
*
|
|
216
|
+
* @param {function | string | number | boolean | Record} arg rotation to keep, or predicate function to match the rotations of the items to keep
|
|
217
|
+
* @returns {this} New instance with only the items which rotation match the argument
|
|
218
|
+
*/
|
|
134
219
|
Material.prototype.rotation = function (arg) {
|
|
135
220
|
return this.location(function (_a) {
|
|
136
221
|
var rotation = _a.rotation;
|
|
137
222
|
return typeof arg === 'function' ? arg(rotation) : (0, isEqual_1.default)(rotation, arg);
|
|
138
223
|
});
|
|
139
224
|
};
|
|
225
|
+
/**
|
|
226
|
+
* Filters the items based on their owner (item.location.player)
|
|
227
|
+
*
|
|
228
|
+
* @param {function | number} arg player id to keep, or predicate function to match the owner player of the items to keep
|
|
229
|
+
* @returns {this} New instance with only the items which owner match the argument
|
|
230
|
+
*/
|
|
140
231
|
Material.prototype.player = function (arg) {
|
|
141
232
|
return this.location(function (_a) {
|
|
142
233
|
var player = _a.player;
|
|
143
234
|
return typeof arg === 'function' ? arg(player) : player === arg;
|
|
144
235
|
});
|
|
145
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* Filters the items based on their location's id (item.location.id)
|
|
239
|
+
*
|
|
240
|
+
* @param {function | number} arg location id to keep, or predicate function to match the location id of the items to keep
|
|
241
|
+
* @returns {this} New instance with only the items which location id match the argument
|
|
242
|
+
*/
|
|
146
243
|
Material.prototype.locationId = function (arg) {
|
|
147
244
|
return this.location(function (_a) {
|
|
148
245
|
var id = _a.id;
|
|
149
246
|
return typeof arg === 'function' ? arg(id) : (0, isEqual_1.default)(id, arg);
|
|
150
247
|
});
|
|
151
248
|
};
|
|
249
|
+
/**
|
|
250
|
+
* Filters the items based on their location's parent (item.location.parent).
|
|
251
|
+
*
|
|
252
|
+
* @param {function | number} arg location parent to keep, or predicate function to match the location parent of the items to keep
|
|
253
|
+
* @returns {this} New instance with only the items which location parent match the argument
|
|
254
|
+
*/
|
|
152
255
|
Material.prototype.parent = function (arg) {
|
|
153
256
|
return this.location(function (_a) {
|
|
154
257
|
var parent = _a.parent;
|
|
155
258
|
return typeof arg === 'function' ? arg(parent) : (0, isEqual_1.default)(parent, arg);
|
|
156
259
|
});
|
|
157
260
|
};
|
|
261
|
+
/**
|
|
262
|
+
* Filters the items that are selected (item.selected).
|
|
263
|
+
*
|
|
264
|
+
* @param {number | boolean} selected The selected value to compare (default is true)
|
|
265
|
+
* @returns {this} New instance with only the items which are selected
|
|
266
|
+
*/
|
|
158
267
|
Material.prototype.selected = function (selected) {
|
|
159
268
|
if (selected === void 0) { selected = true; }
|
|
160
269
|
return this.filter(function (item) { var _a; return ((_a = item.selected) !== null && _a !== void 0 ? _a : false) === selected; });
|
|
161
270
|
};
|
|
271
|
+
/**
|
|
272
|
+
* Keep only the item that has the minimum value returned by the selector argument.
|
|
273
|
+
* See {@link minBy} from Lodash
|
|
274
|
+
*
|
|
275
|
+
* @param {function} selector The function that evaluate the item's value
|
|
276
|
+
* @returns {this} New instance with only the item which has the minimum value
|
|
277
|
+
*/
|
|
162
278
|
Material.prototype.minBy = function (selector) {
|
|
163
279
|
var min = (0, minBy_1.default)(this.entries, function (entry) { return selector(entry[1]); });
|
|
164
280
|
return this.new(min ? [min] : []);
|
|
165
281
|
};
|
|
282
|
+
/**
|
|
283
|
+
* Keep only the item that has the maximum value returned by the selector argument.
|
|
284
|
+
* See {@link maxBy} from Lodash
|
|
285
|
+
*
|
|
286
|
+
* @param {function} selector The function that evaluate the item's value
|
|
287
|
+
* @returns {this} New instance with only the item which has the maximum value
|
|
288
|
+
*/
|
|
166
289
|
Material.prototype.maxBy = function (selector) {
|
|
167
290
|
var max = (0, maxBy_1.default)(this.entries, function (entry) { return selector(entry[1]); });
|
|
168
291
|
return this.new(max ? [max] : []);
|
|
169
292
|
};
|
|
293
|
+
/**
|
|
294
|
+
* Return a new material instance which items are ordered based on provided selector functions.
|
|
295
|
+
* See {@link orderBy} from Lodash
|
|
296
|
+
*
|
|
297
|
+
* @param {...function} selectors The function or functions that evaluate each item's value
|
|
298
|
+
* @returns {this} New instance with items ordered by the selector functions
|
|
299
|
+
*/
|
|
170
300
|
Material.prototype.sort = function () {
|
|
171
301
|
var selectors = [];
|
|
172
302
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -175,6 +305,14 @@ var Material = (function () {
|
|
|
175
305
|
var orderedItems = (0, orderBy_1.default)(this.entries, selectors.map(function (s) { return function (entry) { return s(entry[1]); }; }));
|
|
176
306
|
return this.new(orderedItems);
|
|
177
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* Return a new material instance with only the first N items.
|
|
310
|
+
* You have to use {@link sort} first as the items are ordered initially by index, which is not relevant.
|
|
311
|
+
* Example: material.sort(item => !item.location.x!).limit(10)
|
|
312
|
+
*
|
|
313
|
+
* @param count Number of items to keep
|
|
314
|
+
* @returns {this} New instance with only the first "count" items
|
|
315
|
+
*/
|
|
178
316
|
Material.prototype.limit = function (count) {
|
|
179
317
|
return this.new(this.entries.slice(0, count));
|
|
180
318
|
};
|
|
@@ -187,9 +325,19 @@ var Material = (function () {
|
|
|
187
325
|
}
|
|
188
326
|
return moves;
|
|
189
327
|
};
|
|
328
|
+
/**
|
|
329
|
+
* Prepare a move that will create a new item
|
|
330
|
+
* @param {MaterialItem} item The item to create
|
|
331
|
+
* @returns {CreateItem} the move that creates an item when executed
|
|
332
|
+
*/
|
|
190
333
|
Material.prototype.createItem = function (item) {
|
|
191
334
|
return this.createItems([item])[0];
|
|
192
335
|
};
|
|
336
|
+
/**
|
|
337
|
+
* Prepare a list of moves to create new items
|
|
338
|
+
* @param {MaterialItem[]} items The items to create
|
|
339
|
+
* @returns {CreateItem[]} the moves that creates the new items when executed
|
|
340
|
+
*/
|
|
193
341
|
Material.prototype.createItems = function (items) {
|
|
194
342
|
var _this = this;
|
|
195
343
|
return this.process(items.map(function (item) { return ({
|
|
@@ -199,10 +347,21 @@ var Material = (function () {
|
|
|
199
347
|
item: item
|
|
200
348
|
}); }));
|
|
201
349
|
};
|
|
350
|
+
/**
|
|
351
|
+
* Prepare one move to create new items
|
|
352
|
+
* @param {MaterialItem[]} items The items to create
|
|
353
|
+
* @returns {CreateItemsAtOnce} the move that creates the new items when executed
|
|
354
|
+
*/
|
|
202
355
|
Material.prototype.createItemsAtOnce = function (items) {
|
|
203
356
|
var move = { kind: moves_1.MoveKind.ItemMove, type: moves_1.ItemMoveType.CreateAtOnce, itemType: this.type, items: items };
|
|
204
357
|
return this.process([move])[0];
|
|
205
358
|
};
|
|
359
|
+
/**
|
|
360
|
+
* Prepare a move that will delete current first item in this material instance
|
|
361
|
+
*
|
|
362
|
+
* @param {number | undefined} quantity Optional: for items with a quantity, the number of items to remove. If undefined, the item is completely removed
|
|
363
|
+
* @returns {DeleteItem} the move that delete the item, or a part of its quantity, when executed
|
|
364
|
+
*/
|
|
206
365
|
Material.prototype.deleteItem = function (quantity) {
|
|
207
366
|
switch (this.length) {
|
|
208
367
|
case 0:
|
|
@@ -213,6 +372,12 @@ var Material = (function () {
|
|
|
213
372
|
return this.limit(1).deleteItems(quantity)[0];
|
|
214
373
|
}
|
|
215
374
|
};
|
|
375
|
+
/**
|
|
376
|
+
* Prepare moves that will delete all the items in this material instance
|
|
377
|
+
*
|
|
378
|
+
* @param {number | undefined} quantity Optional: for items with a quantity, the number of items to remove. If undefined, the items are completely removed
|
|
379
|
+
* @returns {DeleteItem[]} the moves that delete the items, or a part of their quantity, when executed
|
|
380
|
+
*/
|
|
216
381
|
Material.prototype.deleteItems = function (quantity) {
|
|
217
382
|
var _this = this;
|
|
218
383
|
return this.process(this.entries.map(function (entry) {
|
|
@@ -227,10 +392,22 @@ var Material = (function () {
|
|
|
227
392
|
return move;
|
|
228
393
|
}));
|
|
229
394
|
};
|
|
395
|
+
/**
|
|
396
|
+
* Prepare one move that will delete all the items in this material instance
|
|
397
|
+
*
|
|
398
|
+
* @returns {DeleteItemsAtOnce} the move that delete the items when executed
|
|
399
|
+
*/
|
|
230
400
|
Material.prototype.deleteItemsAtOnce = function () {
|
|
231
401
|
var moves = { kind: moves_1.MoveKind.ItemMove, type: moves_1.ItemMoveType.DeleteAtOnce, itemType: this.type, indexes: this.getIndexes() };
|
|
232
402
|
return this.process([moves])[0];
|
|
233
403
|
};
|
|
404
|
+
/**
|
|
405
|
+
* Prepare a move that will change the location of the current first item in this material instance
|
|
406
|
+
*
|
|
407
|
+
* @param {Location | function} location The new location of the item. It can be a function to process the location based on the item current state.
|
|
408
|
+
* @param {number | undefined} quantity Optional: for items with a quantity, the number of items to move. If undefined, the item is completely moved.
|
|
409
|
+
* @returns {MoveItem} the move that will change the location of the item (or a part of its quantity) when executed
|
|
410
|
+
*/
|
|
234
411
|
Material.prototype.moveItem = function (location, quantity) {
|
|
235
412
|
switch (this.length) {
|
|
236
413
|
case 0:
|
|
@@ -241,6 +418,13 @@ var Material = (function () {
|
|
|
241
418
|
return this.limit(1).moveItems(location, quantity)[0];
|
|
242
419
|
}
|
|
243
420
|
};
|
|
421
|
+
/**
|
|
422
|
+
* Prepare moves that will change the location of all the items in this material instance
|
|
423
|
+
*
|
|
424
|
+
* @param {Location | function} location The new location of the items. It can be a function to process the location based on each item current state.
|
|
425
|
+
* @param {number | undefined} quantity Optional: for items with a quantity, the number of items to move. If undefined, the items are completely moved.
|
|
426
|
+
* @returns {MoveItem[]} the moves that will change the location of the items (or a part of their quantity) when executed
|
|
427
|
+
*/
|
|
244
428
|
Material.prototype.moveItems = function (location, quantity) {
|
|
245
429
|
var _this = this;
|
|
246
430
|
var getLocation = typeof location === 'function' ? location : function () { return location; };
|
|
@@ -258,6 +442,12 @@ var Material = (function () {
|
|
|
258
442
|
return move;
|
|
259
443
|
}));
|
|
260
444
|
};
|
|
445
|
+
/**
|
|
446
|
+
* Prepare one move that will change the location of all the items in this material instance
|
|
447
|
+
*
|
|
448
|
+
* @param {Location | function} location The new location of the items. It can be a function to process the location based on each item current state.
|
|
449
|
+
* @returns {MoveItemsAtOnce} the move that will change the location of the items when executed
|
|
450
|
+
*/
|
|
261
451
|
Material.prototype.moveItemsAtOnce = function (location) {
|
|
262
452
|
var move = {
|
|
263
453
|
kind: moves_1.MoveKind.ItemMove,
|
|
@@ -271,6 +461,12 @@ var Material = (function () {
|
|
|
271
461
|
};
|
|
272
462
|
return this.process([move])[0];
|
|
273
463
|
};
|
|
464
|
+
/**
|
|
465
|
+
* Prepare a move that will select current first item in this material instance
|
|
466
|
+
*
|
|
467
|
+
* @param {number | undefined} quantity Optional: for items with a quantity, the number of items to select. If undefined, the item is completely selected.
|
|
468
|
+
* @returns {SelectItem} the move that will select the item (or a part of its quantity) when executed
|
|
469
|
+
*/
|
|
274
470
|
Material.prototype.selectItem = function (quantity) {
|
|
275
471
|
switch (this.length) {
|
|
276
472
|
case 0:
|
|
@@ -281,6 +477,12 @@ var Material = (function () {
|
|
|
281
477
|
return this.limit(1).selectItems(quantity)[0];
|
|
282
478
|
}
|
|
283
479
|
};
|
|
480
|
+
/**
|
|
481
|
+
* Prepare a move that will select all the items in this material instance
|
|
482
|
+
*
|
|
483
|
+
* @param {number | undefined} quantity Optional: for items with a quantity, the number of items to select. If undefined, the items are completely selected.
|
|
484
|
+
* @returns {SelectItem[]} the moves that will select the items (or a part of their quantity) when executed
|
|
485
|
+
*/
|
|
284
486
|
Material.prototype.selectItems = function (quantity) {
|
|
285
487
|
var _this = this;
|
|
286
488
|
return this.process(this.entries.map(function (entry) {
|
|
@@ -295,6 +497,12 @@ var Material = (function () {
|
|
|
295
497
|
return move;
|
|
296
498
|
}));
|
|
297
499
|
};
|
|
500
|
+
/**
|
|
501
|
+
* Prepare a move that will unselect current first item in this material instance
|
|
502
|
+
*
|
|
503
|
+
* @param {number | undefined} quantity Optional: for items with a quantity, the number of items to unselect. If undefined, the item is completely unselected.
|
|
504
|
+
* @returns {SelectItem} the move that will unselect the item (or a part of its quantity) when executed
|
|
505
|
+
*/
|
|
298
506
|
Material.prototype.unselectItem = function (quantity) {
|
|
299
507
|
switch (this.length) {
|
|
300
508
|
case 0:
|
|
@@ -305,6 +513,12 @@ var Material = (function () {
|
|
|
305
513
|
return this.limit(1).unselectItems(quantity)[0];
|
|
306
514
|
}
|
|
307
515
|
};
|
|
516
|
+
/**
|
|
517
|
+
* Prepare a move that will unselect all the items in this material instance
|
|
518
|
+
*
|
|
519
|
+
* @param {number | undefined} quantity Optional: for items with a quantity, the number of items to unselect. If undefined, the items are completely unselected.
|
|
520
|
+
* @returns {SelectItem[]} the moves that will unselect the items (or a part of their quantity) when executed
|
|
521
|
+
*/
|
|
308
522
|
Material.prototype.unselectItems = function (quantity) {
|
|
309
523
|
var _this = this;
|
|
310
524
|
return this.process(this.entries.map(function (entry) {
|
|
@@ -320,6 +534,14 @@ var Material = (function () {
|
|
|
320
534
|
return move;
|
|
321
535
|
}));
|
|
322
536
|
};
|
|
537
|
+
/**
|
|
538
|
+
* Prepare a move that will rotate current first item in this material instance.
|
|
539
|
+
* This function creates a {@link MoveItem} but copies the existing location values, only replacing the rotation property.
|
|
540
|
+
*
|
|
541
|
+
* @param {string | number | boolean | Record | function | undefined} arg Value of the rotation to give to the item.
|
|
542
|
+
* In case of a function, process the value based on the item state.
|
|
543
|
+
* @returns {MoveItem} the move that will rotate the item when executed
|
|
544
|
+
*/
|
|
323
545
|
Material.prototype.rotateItem = function (arg) {
|
|
324
546
|
switch (this.length) {
|
|
325
547
|
case 0:
|
|
@@ -330,6 +552,14 @@ var Material = (function () {
|
|
|
330
552
|
return this.limit(1).rotateItems(arg)[0];
|
|
331
553
|
}
|
|
332
554
|
};
|
|
555
|
+
/**
|
|
556
|
+
* Prepare a move that will rotate all the items in this material instance.
|
|
557
|
+
* This function creates an array of {@link MoveItem} but copies the existing locations values, only replacing the rotation property.
|
|
558
|
+
*
|
|
559
|
+
* @param {string | number | boolean | Record | function | undefined} arg Value of the rotation to give to the item.
|
|
560
|
+
* In case of a function, process the value based on the item state.
|
|
561
|
+
* @returns {MoveItem[]} the moves that will rotate the item when executed
|
|
562
|
+
*/
|
|
333
563
|
Material.prototype.rotateItems = function (arg) {
|
|
334
564
|
return this.moveItems(function (item) {
|
|
335
565
|
var rotation = typeof arg === 'function' ? arg(item) : arg;
|
|
@@ -337,6 +567,10 @@ var Material = (function () {
|
|
|
337
567
|
return rotation !== undefined ? (__assign(__assign({}, location), { rotation: rotation })) : location;
|
|
338
568
|
});
|
|
339
569
|
};
|
|
570
|
+
/**
|
|
571
|
+
* Prepare a move that will shuffle all the items in the current material instance
|
|
572
|
+
* @returns {Shuffle} the move that shuffle the items when executed
|
|
573
|
+
*/
|
|
340
574
|
Material.prototype.shuffle = function () {
|
|
341
575
|
return this.process([{
|
|
342
576
|
kind: moves_1.MoveKind.ItemMove,
|
|
@@ -345,6 +579,12 @@ var Material = (function () {
|
|
|
345
579
|
indexes: this.entries.map(function (entry) { return entry[0]; })
|
|
346
580
|
}])[0];
|
|
347
581
|
};
|
|
582
|
+
/**
|
|
583
|
+
* Prepare a move that will roll the current first item in this material instance. See {@link RollItem}.
|
|
584
|
+
*
|
|
585
|
+
* @param {Location | function} location The new location of the item. It can be a function to process the location based on the item current state.
|
|
586
|
+
* @returns {RollItem} the move that rolls the item when executed
|
|
587
|
+
*/
|
|
348
588
|
Material.prototype.rollItem = function (location) {
|
|
349
589
|
switch (this.length) {
|
|
350
590
|
case 0:
|
|
@@ -355,6 +595,12 @@ var Material = (function () {
|
|
|
355
595
|
return this.limit(1).rollItems(location)[0];
|
|
356
596
|
}
|
|
357
597
|
};
|
|
598
|
+
/**
|
|
599
|
+
* Prepare a move that will roll all the items in this material instance. See {@link RollItem}.
|
|
600
|
+
*
|
|
601
|
+
* @param {Location | function} location The new location of the items. It can be a function to process the location based on each item current state.
|
|
602
|
+
* @returns {RollItem[]} the moves that rolls the items when executed
|
|
603
|
+
*/
|
|
358
604
|
Material.prototype.rollItems = function (location) {
|
|
359
605
|
var _this = this;
|
|
360
606
|
if (location === void 0) { location = function (item) { return item.location; }; }
|
|
@@ -370,9 +616,22 @@ var Material = (function () {
|
|
|
370
616
|
});
|
|
371
617
|
}));
|
|
372
618
|
};
|
|
619
|
+
/**
|
|
620
|
+
* Return a new {@link MaterialDeck} helper class, to deal cards easily.
|
|
621
|
+
*
|
|
622
|
+
* @param selector The sort to apply on the deck. See {@link sort}. Defaults to -item.location.x
|
|
623
|
+
*/
|
|
373
624
|
Material.prototype.deck = function (selector) {
|
|
374
625
|
if (selector === void 0) { selector = function (item) { return -item.location.x; }; }
|
|
375
|
-
return new
|
|
626
|
+
return new index_1.MaterialDeck(this.type, this.items, this.processMove, this.entries).sort(selector);
|
|
627
|
+
};
|
|
628
|
+
/**
|
|
629
|
+
* Return a new {@link MaterialMoney} helper class, to deal with moving money units easily.
|
|
630
|
+
*
|
|
631
|
+
* @param units The different units that exists in stock to count this money
|
|
632
|
+
*/
|
|
633
|
+
Material.prototype.money = function (units) {
|
|
634
|
+
return new index_1.MaterialMoney(this.type, units, this.items, this.processMove, this.entries);
|
|
376
635
|
};
|
|
377
636
|
return Material;
|
|
378
637
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Material.js","sourceRoot":"","sources":["../../../src/material/items/Material.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAAoC;AACpC,uDAAgC;AAChC,uDAAgC;AAChC,2DAAoC;AACpC,uDAAgC;AAEhC,kCAaiB;AACjB,+CAA6C;AAc7C;IAQE,kBACW,IAAO,EACP,OAA0B,EAChB,WAA+C;QAFzD,SAAI,GAAJ,IAAI,CAAG;QACP,YAAO,GAAP,OAAO,CAAmB;QAChB,gBAAW,GAA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ACJ,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;IAED;;;;OAIG;IACH,uBAAI,GAAJ,UAAK,QAA0E;QAA1E,yBAAA,EAAA,qBAAiD,IAAI,IAAI,OAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAE,EAAjB,CAAiB;QAC7E,OAAO,IAAI,oBAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC/F,CAAC;IAED;;;;OAIG;IACH,wBAAK,GAAL,UAA2B,KAAa;QACtC,OAAO,IAAI,qBAAa,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACxF,CAAC;IACH,eAAC;AAAD,CAAC,AA5kBD,IA4kBC;AA5kBY,4BAAQ"}
|
|
@@ -1,9 +1,42 @@
|
|
|
1
1
|
import { Location } from '../location';
|
|
2
2
|
import { MoveItem } from '../moves';
|
|
3
|
-
import { Material } from './
|
|
3
|
+
import { Material } from './index';
|
|
4
4
|
import { MaterialItem } from './MaterialItem';
|
|
5
|
+
/**
|
|
6
|
+
* This subclass of {@link Material} is design to solve one major issue: when creating moves, the material items remains unchanged (Material is immutable),
|
|
7
|
+
* so you cannot easily deal cards to multiple players at once: you will deal the first X cards all the time if you try to move items multiple time one
|
|
8
|
+
* the same Material instance.
|
|
9
|
+
*
|
|
10
|
+
* MaterialDeck is designed to mutate every time the {@link deal}, {@link dealOne} or {@link dealAtOnce} function are executed, allowing to deal cards
|
|
11
|
+
* successively to the players, without having to remove the previously dealt card all the time.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* In this example, we deal the first 5 cards to the player 1, then the next 5 cards to player 2.
|
|
15
|
+
* Using "move" instead of "deal" would give the 5 same cards to both players,
|
|
16
|
+
* so player 1 would get the cards for a very short time, then player 2 would receive them.
|
|
17
|
+
* ```
|
|
18
|
+
* const deck = this.material(MaterialType.Card).deck()
|
|
19
|
+
* return [
|
|
20
|
+
* deck.deal({type: LocationType.PlayerHand, player: player1}, 5)
|
|
21
|
+
* deck.deal({type: LocationType.PlayerHand, player: player2}, 5)
|
|
22
|
+
* ]
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
5
25
|
export declare class MaterialDeck<P extends number = number, M extends number = number, L extends number = number> extends Material<P, M, L> {
|
|
26
|
+
/**
|
|
27
|
+
* Prepare moves that will change the location of the first X items AND mutate this MaterialDeck instance to remove the items that will move.
|
|
28
|
+
*
|
|
29
|
+
* @param {Location | function} arg The new location of the item. It can be a function to process the location based on the item current state.
|
|
30
|
+
* @param quantity The number of items to move
|
|
31
|
+
* @returns {MoveItem[]} the move that will change the location of the item (or a part of its quantity) when executed
|
|
32
|
+
*/
|
|
6
33
|
deal(arg: ((item: MaterialItem<P, L>) => Location<P, L>) | Location<P, L>, quantity?: number): MoveItem<P, M, L>[];
|
|
34
|
+
/**
|
|
35
|
+
* Prepare a move that will change the location of the first item AND mutate this MaterialDeck instance to remove this items
|
|
36
|
+
*
|
|
37
|
+
* @param {Location | function} arg The new location of the item. It can be a function to process the location based on the item current state.
|
|
38
|
+
* @returns {MoveItem} the move that will change the location of the item (or a part of its quantity) when executed
|
|
39
|
+
*/
|
|
7
40
|
dealOne(arg: ((item: MaterialItem<P, L>) => Location<P, L>) | Location<P, L>): MoveItem<P, M, L>;
|
|
8
41
|
dealAtOnce(arg: Location<P, L>, quantity?: number): import("../moves").MoveItemsAtOnce<P, M, L>;
|
|
9
42
|
}
|