本文整理汇总了TypeScript中game.router.cont方法的典型用法代码示例。如果您正苦于以下问题:TypeScript router.cont方法的具体用法?TypeScript router.cont怎么用?TypeScript router.cont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game.router
的用法示例。
在下文中一共展示了router.cont方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: view
export function view(ctrl: AnalyseCtrl): VNode {
const d = ctrl.data,
noarg = ctrl.trans.noarg;
const flipOpts = d.userAnalysis ? {
hook: bind('click', ctrl.flip)
} : {
attrs: { href: router.game(d, d.opponent.color, ctrl.embed) + '#' + ctrl.node.ply }
};
const canContinue = !ctrl.ongoing && !ctrl.embed && d.game.variant.key === 'standard';
const ceval = ctrl.getCeval();
const mandatoryCeval = ctrl.mandatoryCeval();
const tools: MaybeVNodes = [
h('div.tools', [
h('a.fbt', flipOpts, [
h('i.icon', { attrs: dataIcon('B') }),
noarg('flipBoard')
]),
ctrl.ongoing ? null : h('a.fbt', {
attrs: {
href: d.userAnalysis ? '/editor?fen=' + ctrl.node.fen : '/' + d.game.id + '/edit?fen=' + ctrl.node.fen,
rel: 'nofollow',
target: ctrl.embed ? '_blank' : ''
}
}, [
h('i.icon', { attrs: dataIcon('m') }),
noarg('boardEditor')
]),
canContinue ? h('a.fbt', {
hook: bind('click', _ => $.modal($('.continue_with.g_' + d.game.id)))
}, [
h('i.icon', {
attrs: dataIcon('U')
}),
noarg('continueFromHere')
]) : null,
studyButton(ctrl)
])
];
const cevalConfig: MaybeVNodes = (ceval && ceval.possible && ceval.allowed()) ? ([
h('h2', noarg('computerAnalysis'))
] as MaybeVNodes).concat([
boolSetting(ctrl, {
name: 'enable',
title: mandatoryCeval ? "Required by practice mode" : window.lichess.engineName,
id: 'all',
checked: ctrl.showComputer(),
disabled: mandatoryCeval,
change: ctrl.toggleComputer
})
]).concat(
ctrl.showComputer() ? [
boolSetting(ctrl, {
name: 'bestMoveArrow',
title: 'a',
id: 'shapes',
checked: ctrl.showAutoShapes(),
change: ctrl.toggleAutoShapes
}),
boolSetting(ctrl, {
name: 'evaluationGauge',
id: 'gauge',
checked: ctrl.showGauge(),
change: ctrl.toggleGauge
}),
boolSetting(ctrl, {
name: 'infiniteAnalysis',
title: 'removesTheDepthLimit',
id: 'infinite',
checked: ceval.infinite(),
change: ctrl.cevalSetInfinite
}),
(id => {
const max = 5;
return h('div.setting', [
h('label', { attrs: { 'for': id } }, noarg('multipleLines')),
h('input#' + id, {
attrs: {
type: 'range',
min: 1,
max,
step: 1
},
hook: rangeConfig(
() => parseInt(ceval!.multiPv()),
ctrl.cevalSetMultiPv)
}),
h('div.range_value', ceval.multiPv() + ' / ' + max)
]);
})('analyse-multipv'),
ceval.pnaclSupported ? (id => {
let max = navigator.hardwareConcurrency;
if (!max) return;
if (max > 2) max--; // don't overload your computer, you dummy
return h('div.setting', [
h('label', { attrs: { 'for': id } }, noarg('cpus')),
h('input#' + id, {
//.........这里部分代码省略.........