本文整理匯總了TypeScript中game.status.aborted方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript status.aborted方法的具體用法?TypeScript status.aborted怎麽用?TypeScript status.aborted使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類game.status
的用法示例。
在下文中一共展示了status.aborted方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: followUp
export function followUp(ctrl: RoundController): VNode {
const d = ctrl.data,
rematchable = !d.game.rematch && (status.finished(d) || status.aborted(d)) && !d.tournament && !d.simul && !d.game.boosted && (d.opponent.onGame || (!d.clock && d.player.user && d.opponent.user)),
newable = (status.finished(d) || status.aborted(d)) && (
d.game.source === 'lobby' ||
d.game.source === 'pool'),
rematchZone = ctrl.challengeRematched ? [
h('div.suggestion.text', util.justIcon('j'), ctrl.trans.noarg('rematchOfferSent')
)] : (rematchable || d.game.rematch ? rematchButtons(ctrl) : [
h('a.button.rematch.white',
{ class: { disabled: true } },
[h('span', ctrl.trans.noarg('rematch'))]
)
]);
return h('div.follow_up', [
...rematchZone,
d.tournament ? h('a.button', {
attrs: {href: '/tournament/' + d.tournament.id}
}, ctrl.trans.noarg('viewTournament')) : null,
newable ? h('a.button', {
attrs: {href: d.game.source === 'pool' ? poolUrl(d.clock!) : '/?hook_like=' + d.game.id },
}, ctrl.trans.noarg('newOpponent')) : null,
analysisButton(ctrl)
]);
}
示例2: renderResult
function renderResult(ctrl: RoundController) {
let result;
if (status.finished(ctrl.data)) switch (ctrl.data.game.winner) {
case 'white':
result = '1-0';
break;
case 'black':
result = '0-1';
break;
default:
result = '½-½';
}
if (result || status.aborted(ctrl.data)) {
const winner = game.getPlayer(ctrl.data, ctrl.data.game.winner);
return h('div.result_wrap', [
result ? h('p.result', result) : null,
h('p.status', {
hook: {
insert: _ => {
if (ctrl.autoScroll) ctrl.autoScroll();
else setTimeout(() => ctrl.autoScroll(), 200);
}
}
}, [
h('div', gameView.status(ctrl)),
winner ? h('div', ctrl.trans.noarg(winner.color + 'IsVictorious')) : null
])
]);
}
return;
}
示例3: whosTurn
function whosTurn(ctrl: RoundController, color: Color) {
var d = ctrl.data;
if (status.finished(d) || status.aborted(d)) return;
return h('div.whos_turn',
d.game.player === color ? (
d.player.spectator ? ctrl.trans(d.game.player + 'Plays') : ctrl.trans(
d.game.player === d.player.color ? 'yourTurn' : 'waitingForOpponent'
)
) : ''
);
}