@gamepark/rules-api
Version:
API to implement the rules of a board game
44 lines • 1.87 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocationBuilder = void 0;
var LocationBuilder = /** @class */ (function () {
function LocationBuilder(location) {
this.location = location;
}
LocationBuilder.prototype.id = function (id) {
return new LocationBuilder(__assign(__assign({}, this.location), { id: id }));
};
LocationBuilder.prototype.player = function (player) {
return new LocationBuilder(__assign(__assign({}, this.location), { player: player }));
};
LocationBuilder.prototype.parent = function (arg) {
var parent = typeof arg === 'number' ? arg : arg.entries[0][0];
return new LocationBuilder(__assign(__assign({}, this.location), { parent: parent }));
};
LocationBuilder.prototype.x = function (x) {
return new LocationBuilder(__assign(__assign({}, this.location), { x: x }));
};
LocationBuilder.prototype.y = function (y) {
return new LocationBuilder(__assign(__assign({}, this.location), { y: y }));
};
LocationBuilder.prototype.z = function (z) {
return new LocationBuilder(__assign(__assign({}, this.location), { z: z }));
};
LocationBuilder.prototype.rotation = function (rotation) {
return new LocationBuilder(__assign(__assign({}, this.location), { rotation: rotation }));
};
return LocationBuilder;
}());
exports.LocationBuilder = LocationBuilder;
//# sourceMappingURL=LocationBuilder.js.map