本文整理汇总了TypeScript中chess.fixCrazySan函数的典型用法代码示例。如果您正苦于以下问题:TypeScript fixCrazySan函数的具体用法?TypeScript fixCrazySan怎么用?TypeScript fixCrazySan使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fixCrazySan函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: renderVariationMoveOf
function renderVariationMoveOf(ctx: Ctx, node: Tree.Node, opts: Opts): VNode {
const withIndex = opts.withIndex || node.ply % 2 === 1,
path = opts.parentPath + node.id,
content: MaybeVNodes = [
withIndex ? moveView.renderIndex(node.ply, true) : null,
fixCrazySan(node.san!)
],
classes = nodeClasses(ctx, path);
if (opts.conceal) classes[opts.conceal as string] = true;
if (node.glyphs) moveView.renderGlyphs(node.glyphs).forEach(g => content.push(g));
return h('move', {
attrs: { p: path },
class: classes
}, content);
}
示例2: onMyTurn
function onMyTurn(ctrl: AnalyseCtrl, fctrl: ForecastCtrl, cNodes: ForecastStep[]): VNode | undefined {
var firstNode = cNodes[0];
if (!firstNode) return;
var fcs = fctrl.findStartingWithNode(firstNode);
if (!fcs.length) return;
var lines = fcs.filter(function(fc) {
return fc.length > 1;
});
return h('button.on-my-turn.add.button.text', {
attrs: dataIcon('E'),
hook: bind('click', _ => fctrl.playAndSave(firstNode))
}, [
h('span', h('strong', ctrl.trans('playX', fixCrazySan(cNodes[0].san)))),
lines.length ?
h('span', ctrl.trans.plural('andSaveNbPremoveLines', lines.length)) :
h('span', ctrl.trans.noarg('noConditionalPremoves'))
]);
}
示例3: onMyTurn
function onMyTurn(fctrl, cNodes) {
var firstNode = cNodes[0];
if (!firstNode) return;
var fcs = fctrl.findStartingWithNode(firstNode);
if (!fcs.length) return;
var lines = fcs.filter(function(fc) {
return fc.length > 1;
});
return h('button.on-my-turn.add.button.text', {
attrs: dataIcon('E'),
hook: bind('click', _ => fctrl.playAndSave(firstNode))
}, [
h('span', h('strong', 'Play ' + fixCrazySan(cNodes[0].san))),
lines.length ?
h('span', 'and save ' + lines.length + ' premove line' + (lines.length > 1 ? 's' : '')) :
h('span', 'No conditional premoves')
]);
};
示例4: nodeFullName
export function nodeFullName(node: Tree.Node) {
if (node.san) return plyToTurn(node.ply) + (
node.ply % 2 === 1 ? '.' : '...'
) + ' ' + fixCrazySan(node.san);
return 'Initial position';
}
示例5: fixCrazySan
nodes.forEach(node => {
if (node.ply === 0) return;
if (node.ply % 2 === 1) tags.push(h('index', ((node.ply + 1) / 2) + '.'));
tags.push(h('san', fixCrazySan(node.san!)));
});