@gamepark/rules-api
Version:
API to implement the rules of a board game
18 lines • 637 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGameView = void 0;
var HiddenInformation_1 = require("../HiddenInformation");
var SecretInformation_1 = require("../SecretInformation");
function getGameView(rules, playerId) {
if ((0, SecretInformation_1.hasSecretInformation)(rules) && playerId !== undefined) {
return rules.getPlayerView(playerId);
}
else if ((0, HiddenInformation_1.hasHiddenInformation)(rules)) {
return rules.getView();
}
else {
return rules.game;
}
}
exports.getGameView = getGameView;
//# sourceMappingURL=game-view.util.js.map