@gamepark/rules-api 6.24.3 → 6.26.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/RandomMove.d.ts +3 -2
- package/dist/material/HiddenMaterialRules.d.ts +1 -1
- package/dist/material/HiddenMaterialRules.js +10 -13
- package/dist/material/HiddenMaterialRules.js.map +1 -1
- package/dist/material/MaterialGameSetup.js +1 -4
- package/dist/material/MaterialGameSetup.js.map +1 -1
- package/dist/material/MaterialRules.d.ts +8 -1
- package/dist/material/MaterialRules.js +14 -4
- package/dist/material/MaterialRules.js.map +1 -1
- package/dist/material/items/Material.d.ts +13 -6
- package/dist/material/items/Material.js +18 -6
- package/dist/material/items/Material.js.map +1 -1
- package/dist/material/items/MaterialDeck.d.ts +1 -1
- package/dist/material/items/MaterialDeck.js +2 -2
- package/dist/material/items/MaterialDeck.js.map +1 -1
- 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.js +3 -3
- 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/rules/MaterialRulesPart.js +1 -2
- package/dist/material/rules/MaterialRulesPart.js.map +1 -1
- package/dist/utils/action-view.util.js +1 -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/grid.hex.util.d.ts +115 -0
- package/dist/utils/grid.hex.util.js +197 -0
- package/dist/utils/grid.hex.util.js.map +1 -0
- package/dist/utils/grid.util.d.ts +9 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/money.util.d.ts +1 -0
- package/dist/utils/money.util.js +1 -0
- package/dist/utils/money.util.js.map +1 -1
- package/dist/utils/random.util.d.ts +1 -8
- package/dist/utils/random.util.js +1 -16
- package/dist/utils/random.util.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
18
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
19
|
+
if (ar || !(i in from)) {
|
|
20
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
21
|
+
ar[i] = from[i];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.MaterialMoney = void 0;
|
|
31
|
+
var lodash_1 = require("lodash");
|
|
32
|
+
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
33
|
+
var keyBy_1 = __importDefault(require("lodash/keyBy"));
|
|
34
|
+
var mapValues_1 = __importDefault(require("lodash/mapValues"));
|
|
35
|
+
var sumBy_1 = __importDefault(require("lodash/sumBy"));
|
|
36
|
+
var index_1 = require("./index");
|
|
37
|
+
var MaterialMutator_1 = require("./MaterialMutator");
|
|
38
|
+
/**
|
|
39
|
+
* This subclass of {@link Material} is design to handle counting and moving Money with different units: coins of 5 and 1 for instance.
|
|
40
|
+
* It also keeps track of how much money is left after spending moves are create so that it is easy to spend money multiple time at once,
|
|
41
|
+
* without risking spending the same coins twice because the moves are no immediately executed.
|
|
42
|
+
*/
|
|
43
|
+
var MaterialMoney = /** @class */ (function (_super) {
|
|
44
|
+
__extends(MaterialMoney, _super);
|
|
45
|
+
/**
|
|
46
|
+
* Construct a new Material Money helper instance
|
|
47
|
+
* @param {number} type Type of items this instance will work on
|
|
48
|
+
* @param {MaterialItem[]} items The complete list of items of this type in current game state.
|
|
49
|
+
* @param {number[]} units The different units that exists in stock to count this money
|
|
50
|
+
* @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
|
|
51
|
+
* @param {function} processMove if provided, this function will be executed on every move created with this instance
|
|
52
|
+
*/
|
|
53
|
+
function MaterialMoney(type, units, 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; }); }
|
|
56
|
+
var _this = _super.call(this, type, items, processMove, entries) || this;
|
|
57
|
+
_this.type = type;
|
|
58
|
+
_this.units = units;
|
|
59
|
+
_this.items = items;
|
|
60
|
+
_this.processMove = processMove;
|
|
61
|
+
_this.entries = entries;
|
|
62
|
+
_this.pendingMoves = [];
|
|
63
|
+
if (_this.units[0] === 1) {
|
|
64
|
+
_this.units = __spreadArray([], units, true);
|
|
65
|
+
_this.units.sort(function (a, b) { return b - a; }); // Sort units from highest to 1
|
|
66
|
+
}
|
|
67
|
+
if (_this.units[_this.units.length - 1] !== 1)
|
|
68
|
+
console.warn('Money without 1 in the possible values will produce unexpected outcomes');
|
|
69
|
+
return _this;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Helper function to return a new instance of the same class (works also for children class)
|
|
73
|
+
* @param {ItemEntry[]} entries Filtered entries for the new class
|
|
74
|
+
* @returns {this} the new Material instance
|
|
75
|
+
* @protected
|
|
76
|
+
*/
|
|
77
|
+
MaterialMoney.prototype.new = function (entries) {
|
|
78
|
+
var Class = this.constructor;
|
|
79
|
+
return new Class(this.type, this.units, this.items, this.processMove, entries);
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* We need to apply the pending moves before any filtering is done to get the right count for instance.
|
|
83
|
+
*/
|
|
84
|
+
MaterialMoney.prototype.filter = function (predicate) {
|
|
85
|
+
this.applyPendingMoves();
|
|
86
|
+
return _super.prototype.filter.call(this, predicate);
|
|
87
|
+
};
|
|
88
|
+
Object.defineProperty(MaterialMoney.prototype, "count", {
|
|
89
|
+
/**
|
|
90
|
+
* Count the total value of a material instance
|
|
91
|
+
* @returns the sum of each item id multiplied by its quantity
|
|
92
|
+
*/
|
|
93
|
+
get: function () {
|
|
94
|
+
this.applyPendingMoves();
|
|
95
|
+
return (0, sumBy_1.default)(this.getItems(), function (item) { var _a, _b; return ((_a = item.id) !== null && _a !== void 0 ? _a : 1) * ((_b = item.quantity) !== null && _b !== void 0 ? _b : 1); });
|
|
96
|
+
},
|
|
97
|
+
enumerable: false,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Create an amount of Money and put it in given location
|
|
102
|
+
* @param amount Amount to gain
|
|
103
|
+
* @param location The location to filter material onto, and to create new items in
|
|
104
|
+
* @returns the moves that need to be played to perform the operation
|
|
105
|
+
*/
|
|
106
|
+
MaterialMoney.prototype.addMoney = function (amount, location) {
|
|
107
|
+
var _a;
|
|
108
|
+
if (amount === 0)
|
|
109
|
+
return [];
|
|
110
|
+
if (amount < 0)
|
|
111
|
+
return this.removeMoney(-amount, location);
|
|
112
|
+
var moves = [];
|
|
113
|
+
var gainMap = this.getGainMap(amount);
|
|
114
|
+
for (var _i = 0, _b = this.units; _i < _b.length; _i++) {
|
|
115
|
+
var unit = _b[_i];
|
|
116
|
+
if (gainMap[unit] > 0) {
|
|
117
|
+
moves.push(this.createItem({ id: unit, location: location, quantity: gainMap[unit] }));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
(_a = this.pendingMoves).push.apply(_a, moves);
|
|
121
|
+
return moves;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Remove an amount of Money from given location
|
|
125
|
+
* @param amount Amount to spend
|
|
126
|
+
* @param location The location to filter material onto, and to create new items in
|
|
127
|
+
* @returns the moves that need to be played to perform the operation
|
|
128
|
+
*/
|
|
129
|
+
MaterialMoney.prototype.removeMoney = function (amount, location) {
|
|
130
|
+
var _a;
|
|
131
|
+
if (amount === 0)
|
|
132
|
+
return [];
|
|
133
|
+
if (amount < 0)
|
|
134
|
+
return this.addMoney(-amount, location);
|
|
135
|
+
this.applyPendingMoves();
|
|
136
|
+
if (this.entries.some(function (_a) {
|
|
137
|
+
var item = _a[1];
|
|
138
|
+
return !(0, isEqual_1.default)(item.location, location);
|
|
139
|
+
})) {
|
|
140
|
+
return this.location(function (l) { return (0, isEqual_1.default)(l, location); }).removeMoney(amount, location);
|
|
141
|
+
}
|
|
142
|
+
var moves = [];
|
|
143
|
+
var spendMap = this.getSpendMap(amount);
|
|
144
|
+
for (var _i = 0, _b = this.units; _i < _b.length; _i++) {
|
|
145
|
+
var unit = _b[_i];
|
|
146
|
+
if (spendMap[unit] < 0) {
|
|
147
|
+
moves.push(this.id(unit).deleteItem(-spendMap[unit]));
|
|
148
|
+
}
|
|
149
|
+
else if (spendMap[unit] > 0) {
|
|
150
|
+
moves.push(this.createItem({ id: unit, location: location, quantity: spendMap[unit] }));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
(_a = this.pendingMoves).push.apply(_a, moves);
|
|
154
|
+
return moves;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Move an amount of money from a place to another place. It searches after the easiest way to do it, making money with the bank only if necessary.
|
|
158
|
+
* @param origin Location to remove money from
|
|
159
|
+
* @param target Location to move money to
|
|
160
|
+
* @param amount Amount of money to transfer
|
|
161
|
+
* @returns the moves that need to be played to perform the operation
|
|
162
|
+
*/
|
|
163
|
+
MaterialMoney.prototype.moveMoney = function (origin, target, amount) {
|
|
164
|
+
var _a;
|
|
165
|
+
if (amount === 0)
|
|
166
|
+
return [];
|
|
167
|
+
if (amount < 0)
|
|
168
|
+
return this.moveMoney(target, origin, -amount);
|
|
169
|
+
this.applyPendingMoves();
|
|
170
|
+
var moves = [];
|
|
171
|
+
var originMoney = this.location(function (l) { return (0, isEqual_1.default)(l, origin); });
|
|
172
|
+
var targetMoney = this.location(function (l) { return (0, isEqual_1.default)(l, target); });
|
|
173
|
+
var originDelta = originMoney.getSpendMap(amount);
|
|
174
|
+
var targetDelta = targetMoney.getGainMap(amount);
|
|
175
|
+
for (var _i = 0, _b = this.units; _i < _b.length; _i++) {
|
|
176
|
+
var unit = _b[_i];
|
|
177
|
+
if (originDelta[unit] < 0) {
|
|
178
|
+
var _loop_1 = function () {
|
|
179
|
+
var lowerUnits = this_1.units.slice(this_1.units.indexOf(unit) + 1);
|
|
180
|
+
var targetResultDelta = targetMoney.getSpendMap(unit);
|
|
181
|
+
var valueSpent = (0, sumBy_1.default)(lowerUnits, function (unit) { return -targetResultDelta[unit] * unit; });
|
|
182
|
+
if (valueSpent === unit && lowerUnits.every(function (lowerUnit) { return targetResultDelta[lowerUnit] < 0; })) {
|
|
183
|
+
targetDelta[unit]++;
|
|
184
|
+
for (var _c = 0, lowerUnits_1 = lowerUnits; _c < lowerUnits_1.length; _c++) {
|
|
185
|
+
var lowerUnit = lowerUnits_1[_c];
|
|
186
|
+
targetDelta[lowerUnit] += targetResultDelta[lowerUnit];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
else
|
|
190
|
+
return "break";
|
|
191
|
+
};
|
|
192
|
+
var this_1 = this;
|
|
193
|
+
while (targetDelta[unit] < -originDelta[unit]) {
|
|
194
|
+
var state_1 = _loop_1();
|
|
195
|
+
if (state_1 === "break")
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
var moveAmount = Math.min(-originDelta[unit], targetDelta[unit]);
|
|
199
|
+
targetDelta[unit] -= moveAmount;
|
|
200
|
+
var originMaterialUnit = originMoney.id(unit);
|
|
201
|
+
if (moveAmount > 0) {
|
|
202
|
+
moves.push(originMaterialUnit.moveItem(target, moveAmount));
|
|
203
|
+
}
|
|
204
|
+
if (moveAmount < -originDelta[unit]) {
|
|
205
|
+
moves.push(originMaterialUnit.deleteItem(-originDelta[unit] - moveAmount));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else if (originDelta[unit] > 0) {
|
|
209
|
+
if (targetDelta[unit] < 0) {
|
|
210
|
+
moves.push(targetMoney.id(unit).moveItem(origin, -targetDelta[unit]));
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
moves.push(originMoney.createItem({ id: unit, location: origin, quantity: originDelta[unit] }));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (targetDelta[unit] > 0) {
|
|
217
|
+
moves.push(targetMoney.createItem({ id: unit, location: target, quantity: targetDelta[unit] }));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
(_a = this.pendingMoves).push.apply(_a, moves);
|
|
221
|
+
return moves;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Return the best way to gain an amount, prioritizing the highest unit values
|
|
225
|
+
* @param amount Amount to gain, default 1
|
|
226
|
+
* @returns the record of coins to earn (only positive values)
|
|
227
|
+
*/
|
|
228
|
+
MaterialMoney.prototype.getGainMap = function (amount) {
|
|
229
|
+
var map = (0, mapValues_1.default)((0, keyBy_1.default)(this.units), function (_) { return 0; });
|
|
230
|
+
for (var _i = 0, _a = this.units; _i < _a.length; _i++) {
|
|
231
|
+
var unit = _a[_i];
|
|
232
|
+
map[unit] = Math.floor(amount / unit);
|
|
233
|
+
amount %= unit;
|
|
234
|
+
}
|
|
235
|
+
return map;
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Return the best way to spend an amount of owned units, prioritizing the smallest unit values
|
|
239
|
+
* @param amount Amount to gain, default 1
|
|
240
|
+
* @returns the record of coins to give away and eventually take (positive and negative values)
|
|
241
|
+
*/
|
|
242
|
+
MaterialMoney.prototype.getSpendMap = function (amount) {
|
|
243
|
+
var _this = this;
|
|
244
|
+
var owned = (0, mapValues_1.default)((0, keyBy_1.default)(this.units), function (unit) { return _this.id(unit).getQuantity(); });
|
|
245
|
+
var map = (0, mapValues_1.default)((0, keyBy_1.default)(this.units), function (_) { return 0; });
|
|
246
|
+
for (var _1 = 0; _1 < amount; _1++) {
|
|
247
|
+
for (var i = this.units.length - 1; i >= 0; i--) {
|
|
248
|
+
var unit = this.units[i];
|
|
249
|
+
if (owned[unit] + map[unit] > 0) {
|
|
250
|
+
map[unit]--;
|
|
251
|
+
if (unit > 1) {
|
|
252
|
+
var rest = unit - 1;
|
|
253
|
+
for (var _i = 0, _a = this.units.slice(i + 1); _i < _a.length; _i++) {
|
|
254
|
+
var lowerUnit = _a[_i];
|
|
255
|
+
if (lowerUnit <= rest) {
|
|
256
|
+
map[lowerUnit] += Math.floor(rest / lowerUnit);
|
|
257
|
+
rest -= rest % lowerUnit;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return map;
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Mutate the entries to get the state after
|
|
269
|
+
* @private
|
|
270
|
+
*/
|
|
271
|
+
MaterialMoney.prototype.applyPendingMoves = function () {
|
|
272
|
+
var _this = this;
|
|
273
|
+
if (!this.pendingMoves.length)
|
|
274
|
+
return;
|
|
275
|
+
if (this.items.some(function (item, index) { return item.quantity !== 0 && !_this.entries.some(function (entry) { return entry[0] === index; }); })) {
|
|
276
|
+
console.warn('MaterialMoney cannot track the state of the items on filtered instances, the filter will be cancelled');
|
|
277
|
+
}
|
|
278
|
+
this.items = (0, lodash_1.cloneDeep)(this.items);
|
|
279
|
+
var mutator = new MaterialMutator_1.MaterialMutator(this.type, this.items);
|
|
280
|
+
while (this.pendingMoves.length > 0) {
|
|
281
|
+
mutator.applyMove(this.pendingMoves.shift());
|
|
282
|
+
}
|
|
283
|
+
this.entries = Array.from(this.items.entries()).filter(function (entry) { return entry[1].quantity !== 0; });
|
|
284
|
+
};
|
|
285
|
+
return MaterialMoney;
|
|
286
|
+
}(index_1.Material));
|
|
287
|
+
exports.MaterialMoney = MaterialMoney;
|
|
288
|
+
//# sourceMappingURL=MaterialMoney.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialMoney.js","sourceRoot":"","sources":["../../../src/material/items/MaterialMoney.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAkC;AAClC,2DAAoC;AACpC,uDAAgC;AAChC,+DAAwC;AACxC,uDAAgC;AAGhC,iCAA6C;AAE7C,qDAAmD;AAEnD;;;;GAIG;AACH;IACU,iCAAiB;IAGzB;;;;;;;OAOG;IACH,uBACW,IAAO,EACT,KAAa,EACV,KAAgC,EACvB,WAA+C,EAC3D,OAAiG;QAF9F,sBAAA,EAAA,UAAgC;QAEnC,wBAAA,EAAA,UAA6B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,EAAvB,CAAuB,CAAC;QAExG,YAAA,MAAK,YAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,C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yCAAiB,GAAzB;QAAA,iBAWC;QAVC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM;YAAE,OAAM;QACrC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,OAAA,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,EAAlB,CAAkB,CAAC,EAAtE,CAAsE,CAAC,EAAE,CAAC;YAC7G,OAAO,CAAC,IAAI,CAAC,uGAAuG,CAAC,CAAA;QACvH,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAClC,IAAM,OAAO,GAAG,IAAI,iCAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;QAC1D,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAG,CAAC,CAAA;QAC/C,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,EAAvB,CAAuB,CAAC,CAAA;IAC1F,CAAC;IACH,oBAAC;AAAD,CAAC,AArND,CACU,gBAAQ,GAoNjB;AArNY,sCAAa"}
|
|
@@ -137,7 +137,7 @@ var MaterialMutator = /** @class */ (function () {
|
|
|
137
137
|
if (item.location.type in this.locationsStrategies) {
|
|
138
138
|
var strategy = this.locationsStrategies[item.location.type];
|
|
139
139
|
if (strategy.addItem) {
|
|
140
|
-
var material = new index_1.Material(this.type,
|
|
140
|
+
var material = new index_1.Material(this.type, this.items)
|
|
141
141
|
.location(item.location.type).player(item.location.player).locationId(item.location.id).parent(item.location.parent);
|
|
142
142
|
strategy.addItem(material, item);
|
|
143
143
|
}
|
|
@@ -147,7 +147,7 @@ var MaterialMutator = /** @class */ (function () {
|
|
|
147
147
|
if (item.location.type in this.locationsStrategies) {
|
|
148
148
|
var strategy = this.locationsStrategies[item.location.type];
|
|
149
149
|
if (strategy.moveItem) {
|
|
150
|
-
var material = new index_1.Material(this.type,
|
|
150
|
+
var material = new index_1.Material(this.type, this.items)
|
|
151
151
|
.location(item.location.type).player(item.location.player).locationId(item.location.id).parent(item.location.parent);
|
|
152
152
|
strategy.moveItem(material, item, index);
|
|
153
153
|
}
|
|
@@ -165,7 +165,7 @@ var MaterialMutator = /** @class */ (function () {
|
|
|
165
165
|
if (item.location.type in this.locationsStrategies) {
|
|
166
166
|
var strategy = this.locationsStrategies[item.location.type];
|
|
167
167
|
if (strategy.removeItem) {
|
|
168
|
-
var material = new index_1.Material(this.type,
|
|
168
|
+
var material = new index_1.Material(this.type, this.items)
|
|
169
169
|
.location(item.location.type).player(item.location.player).locationId(item.location.id).parent(item.location.parent);
|
|
170
170
|
strategy.removeItem(material, item);
|
|
171
171
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialMutator.js","sourceRoot":"","sources":["../../../src/material/items/MaterialMutator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAAoC;AACpC,uDAAgC;AAChC,wCAA4E;AAC5E,kCAaiB;AACjB,iCAAgD;AAEhD;;;;;;GAMG;AACH;IACE;;;;;OAKG;IACH,yBACmB,IAAO,EACP,KAA2B,EAC3B,mBAAuE,EACvE,QAAwB;QADxB,oCAAA,EAAA,wBAAuE;QACvE,yBAAA,EAAA,eAAwB;QAHxB,SAAI,GAAJ,IAAI,CAAG;QACP,UAAK,GAAL,KAAK,CAAsB;QAC3B,wBA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UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAjB,CAAiB,CAAC,CAAA;QACpE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,QAAQ,EAAE,CAAC;YAClC,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,yBAAQ,aAAa,CAAC,CAAC,CAAC,KAAE,QAAQ,EAAE,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAE,CAAA;QACzF,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,gCAAM,GAAd,UAAe,IAAmB;;QAChC,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACvC,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,QAAQ,CAAA;QACtB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,GAAG,MAAA,IAAI,CAAC,QAAQ,mCAAI,IAAI,CAAA;QACvC,CAAC;IACH,CAAC;IACH,sBAAC;AAAD,CAAC,AA9PD,IA8PC;AA9PY,0CAAe"}
|
|
@@ -14,8 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
// Important: Material export must come first to prevent a circular file dependency issue (see https://stackoverflow.com/a/67261675/1581466)
|
|
18
18
|
__exportStar(require("./Material"), exports);
|
|
19
|
+
__exportStar(require("./MaterialDeck"), exports);
|
|
19
20
|
__exportStar(require("./MaterialItem"), exports);
|
|
21
|
+
__exportStar(require("./MaterialMoney"), exports);
|
|
20
22
|
__exportStar(require("./MaterialMutator"), exports);
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/material/items/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/material/items/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4IAA4I;AAC5I,6CAA0B;AAC1B,iDAA8B;AAC9B,iDAA8B;AAC9B,kDAA+B;AAC/B,oDAAiC"}
|
|
@@ -42,8 +42,7 @@ var MaterialRulesPart = /** @class */ (function (_super) {
|
|
|
42
42
|
* @returns {Material} the material instance
|
|
43
43
|
*/
|
|
44
44
|
MaterialRulesPart.prototype.material = function (type) {
|
|
45
|
-
|
|
46
|
-
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; }));
|
|
45
|
+
return new items_1.Material(type, this.game.items[type]);
|
|
47
46
|
};
|
|
48
47
|
/**
|
|
49
48
|
* This function is called immediately before an {@link ItemMove} is played.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialRulesPart.js","sourceRoot":"","sources":["../../../src/material/rules/MaterialRulesPart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,qCAAoD;AACpD,kCAAmC;AAEnC,oCAAoD;AACpD,kCAA4F;AAG5F;;;;GAIG;AACH;IACU,qCAAiH;IAD3H;;QAyEE,qBAAe,GAAG,2BAAmB,CAAC,eAAe,CAAA;QACrD,2BAAqB,GAAG,2BAAmB,CAAC,qBAAqB,CAAA;QACjE,eAAS,GAAG,2BAAmB,CAAC,SAAS,CAAA;QACzC,gBAAU,GAAG,2BAAmB,CAAC,UAAU,CAAA;QAC3C,aAAO,GAAG,2BAAmB,CAAC,OAAO,CAAA;;IA2CvC,CAAC;IArHC;;;;OAIG;IACH,oCAAQ,GAAR,UAAS,IAAkB
|
|
1
|
+
{"version":3,"file":"MaterialR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O,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,mBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,qBAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC/F,CAAC;IAED;;;;;OAKG;IACH,oCAAQ,GAAR,UAAkB,GAAc,EAAE,KAAgC,EAAE,MAAe;QACjF,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAC7C,CAAC;IAED;;;;;;OAMG;IACH,kCAAM,GAAN,UAAgB,GAAc,EAAE,MAAe;QAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC3C,CAAC;IAED;;;;OAIG;IACH,kCAAM,GAAN,UAAO,GAAc,EAAE,MAAe;QACpC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACpC,CAAC;IACH,wBAAC;AAAD,CAAC,AAxHD,CACU,aAAK,GAuHd;AAxHqB,8CAAiB"}
|
|
@@ -7,7 +7,7 @@ var automatic_moves_util_1 = require("./automatic-moves.util");
|
|
|
7
7
|
var random_util_1 = require("./random.util");
|
|
8
8
|
function playActionWithViews(rules, move, playerId, recipients, id) {
|
|
9
9
|
if ((0, random_util_1.hasRandomMove)(rules)) {
|
|
10
|
-
move = rules.randomize(move);
|
|
10
|
+
move = rules.randomize(move, playerId);
|
|
11
11
|
}
|
|
12
12
|
var actionWithView = {
|
|
13
13
|
action: { id: id, playerId: playerId, move: move, consequences: [] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-view.util.js","sourceRoot":"","sources":["../../src/utils/action-view.util.ts"],"names":[],"mappings":";;;AACA,0DAA8E;AAE9E,0DAA2D;AAC3D,+DAA4D;AAC5D,6CAA6C;AAY7C,SAAgB,mBAAmB,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AC,MAAc;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAE,MAAuB,CAAC,OAAO,CAAC,CAAA;AACxD,CAAC;AAFD,wCAEC"}
|
|
@@ -5,7 +5,7 @@ var automatic_moves_util_1 = require("./automatic-moves.util");
|
|
|
5
5
|
var random_util_1 = require("./random.util");
|
|
6
6
|
function playAction(rules, move, playerId) {
|
|
7
7
|
if ((0, random_util_1.hasRandomMove)(rules)) {
|
|
8
|
-
move = rules.randomize(move);
|
|
8
|
+
move = rules.randomize(move, playerId);
|
|
9
9
|
}
|
|
10
10
|
var action = { playerId: playerId, move: move, consequences: [] };
|
|
11
11
|
var consequences = rules.play(JSON.parse(JSON.stringify(move)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.util.js","sourceRoot":"","sources":["../../src/utils/action.util.ts"],"names":[],"mappings":";;;AAEA,+DAA4D;AAC5D,6CAA6C;AAE7C,SAAgB,UAAU,CAAuB,KAAkC,EAAE,IAAU,EAAE,QAAkB;IACjH,IAAI,IAAA,2BAAa,EAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"action.util.js","sourceRoot":"","sources":["../../src/utils/action.util.ts"],"names":[],"mappings":";;;AAEA,+DAA4D;AAC5D,6CAA6C;AAE7C,SAAgB,UAAU,CAAuB,KAAkC,EAAE,IAAU,EAAE,QAAkB;IACjH,IAAI,IAAA,2BAAa,EAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IACxC,CAAC;IAED,IAAM,MAAM,GAA2B,EAAE,QAAQ,UAAA,EAAE,IAAI,MAAA,EAAE,YAAY,EAAE,EAAE,EAAE,CAAA;IAE3E,IAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAEjE,IAAA,0CAAmB,EAAC,KAAK,EAAE,YAAY,EAAE,UAAA,IAAI,IAAI,OAAA,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAA9B,CAA8B,CAAC,CAAA;IAEhF,OAAO,MAAM,CAAA;AACf,CAAC;AAZD,gCAYC;AAED,SAAgB,YAAY,CAAuB,KAAkC,EAAE,MAA8B;IACnH,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnD,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,UAAA,IAAI,IAAI,OAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAA5C,CAA4C,CAAC,CAAA;AACnF,CAAC;AAHD,oCAGC;AAED,SAAgB,aAAa,CAAuB,KAAkC,EAAE,OAAiC;IACvH,OAAO,CAAC,OAAO,CAAC,UAAA,MAAM,IAAI,OAAA,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,EAA3B,CAA2B,CAAC,CAAA;AACxD,CAAC;AAFD,sCAEC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Location } from '../material';
|
|
2
|
+
import { XYCoordinates } from './grid.util';
|
|
3
|
+
/**
|
|
4
|
+
* The different coordinates systems available to describe a Hexagonal Grid.
|
|
5
|
+
* See https://www.redblobgames.com/grids/hexagons/#coordinates
|
|
6
|
+
*/
|
|
7
|
+
export declare enum HexGridSystem {
|
|
8
|
+
Axial = 0,
|
|
9
|
+
OddQ = 1,
|
|
10
|
+
EvenQ = 2,
|
|
11
|
+
OddR = 3,
|
|
12
|
+
EvenR = 4
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Converts {@link HexGridSystem.OddQ} coordinates into {@link HexGridSystem.Axial} coordinates
|
|
16
|
+
*/
|
|
17
|
+
export declare const oddQToAxial: ({ x, y }: XYCoordinates) => {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Converts {@link HexGridSystem.Axial} coordinates into {@link HexGridSystem.OddQ} coordinates
|
|
23
|
+
*/
|
|
24
|
+
export declare const axialToOddQ: ({ x, y }: XYCoordinates) => {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Converts {@link HexGridSystem.EvenQ} coordinates into {@link HexGridSystem.Axial} coordinates
|
|
30
|
+
*/
|
|
31
|
+
export declare const evenQToAxial: ({ x, y }: XYCoordinates) => {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Converts {@link HexGridSystem.Axial} coordinates into {@link HexGridSystem.EvenQ} coordinates
|
|
37
|
+
*/
|
|
38
|
+
export declare const axialToEvenQ: ({ x, y }: XYCoordinates) => {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Converts {@link HexGridSystem.OddR} coordinates into {@link HexGridSystem.Axial} coordinates
|
|
44
|
+
*/
|
|
45
|
+
export declare const oddRToAxial: ({ x, y }: XYCoordinates) => {
|
|
46
|
+
y: number;
|
|
47
|
+
x: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Converts {@link HexGridSystem.Axial} coordinates into {@link HexGridSystem.OddR} coordinates
|
|
51
|
+
*/
|
|
52
|
+
export declare const axialToOddR: ({ x, y }: XYCoordinates) => {
|
|
53
|
+
y: number;
|
|
54
|
+
x: number;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Converts {@link HexGridSystem.EvenR} coordinates into {@link HexGridSystem.Axial} coordinates
|
|
58
|
+
*/
|
|
59
|
+
export declare const evenRToAxial: ({ x, y }: XYCoordinates) => {
|
|
60
|
+
y: number;
|
|
61
|
+
x: number;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Converts {@link HexGridSystem.Axial} coordinates into {@link HexGridSystem.EvenR} coordinates
|
|
65
|
+
*/
|
|
66
|
+
export declare const axialToEvenR: ({ x, y }: XYCoordinates) => {
|
|
67
|
+
y: number;
|
|
68
|
+
x: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Convert any {@link HexGridSystem} coordinates to {@link HexGridSystem.Axial}
|
|
72
|
+
* @param hex Coordinates to convert
|
|
73
|
+
* @param system System of the coordinates
|
|
74
|
+
* @return Coordinates in {@link HexGridSystem.Axial}
|
|
75
|
+
*/
|
|
76
|
+
export declare function hexToAxial(hex: XYCoordinates, system: HexGridSystem): XYCoordinates;
|
|
77
|
+
/**
|
|
78
|
+
* Convert {@link HexGridSystem.Axial} coordinates to any other {@link HexGridSystem}
|
|
79
|
+
* @param hex Axial coordinates to convert
|
|
80
|
+
* @param system Destination coordinates system
|
|
81
|
+
* @return Coordinates converted in the description system
|
|
82
|
+
*/
|
|
83
|
+
export declare function hexFromAxial(hex: XYCoordinates, system: HexGridSystem): XYCoordinates;
|
|
84
|
+
/**
|
|
85
|
+
* Rotate hexagonal coordinates.
|
|
86
|
+
* @param vector Vector to rotate
|
|
87
|
+
* @param rotation Number of 60 degrees rotations to apply (1 = 60°, 2 = 120°...)
|
|
88
|
+
* @param system The coordinates system used
|
|
89
|
+
* @return the rotated vector
|
|
90
|
+
*/
|
|
91
|
+
export declare function hexRotate(vector: XYCoordinates, rotation?: number, system?: HexGridSystem): XYCoordinates;
|
|
92
|
+
/**
|
|
93
|
+
* Get the distance between 2 hexagons, i.e. the minimum number of hexagons to cross to got from hex1 to hex2.
|
|
94
|
+
* @param hex1 First hexagon coordinates
|
|
95
|
+
* @param hex2 Second hexagon coordinates
|
|
96
|
+
* @param system The coordinates system used
|
|
97
|
+
* @return the distance between the hexagons
|
|
98
|
+
*/
|
|
99
|
+
export declare function getDistanceBetweenHex(hex1: XYCoordinates, hex2: XYCoordinates, system?: HexGridSystem): number;
|
|
100
|
+
/**
|
|
101
|
+
* Translate hexagonal coordinates by a vector.
|
|
102
|
+
* @param hex Coordinates of the hexagon to translate
|
|
103
|
+
* @param vector Vector of the translation
|
|
104
|
+
* @param system The coordinates system used
|
|
105
|
+
* @return The coordinates of the hexagon after the translation
|
|
106
|
+
*/
|
|
107
|
+
export declare function hexTranslate(hex: XYCoordinates, vector: XYCoordinates, system?: HexGridSystem): XYCoordinates;
|
|
108
|
+
/**
|
|
109
|
+
* Get the coordinates that will be covered by a polyhex tile when at a specific grid location.
|
|
110
|
+
* @param polyhex Coordinates occupied by the polyhex without any rotation in given coordinates system
|
|
111
|
+
* @param location Location of the polyhex on the grid (x, y, and rotation)
|
|
112
|
+
* @param system The coordinates system used for the polyhex description and the location
|
|
113
|
+
* @return coordinates in the grid covered when the polyhex has this location
|
|
114
|
+
*/
|
|
115
|
+
export declare function getPolyhexSpaces(polyhex: XYCoordinates[], location: Partial<Location>, system?: HexGridSystem): XYCoordinates[];
|