本文整理汇总了TypeScript中nvui/command.commands.piece类的典型用法代码示例。如果您正苦于以下问题:TypeScript commands.piece类的具体用法?TypeScript commands.piece怎么用?TypeScript commands.piece使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了commands.piece类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: onCommand
function onCommand(ctrl: AnalyseController, notify: (txt: string) => void, c: string, style: Style) {
const pieces = ctrl.chessground.state.pieces;
notify(
commands.piece.apply(c, pieces, style) ||
commands.scan.apply(c, pieces) ||
`Invalid command: ${c}`
);
}
示例2: onCommand
function onCommand(ctrl: RoundController, notify: (txt: string) => void, c: string, style: Style) {
if (c == 'c' || c == 'clock') notify($('.nvui .botc').text() + ', ' + $('.nvui .topc').text());
else if (c == 'l' || c == 'last') notify($('.lastMove').text());
else if (c == 'abort') $('.nvui button.abort').click();
else if (c == 'resign') $('.nvui button.resign-confirm').click();
else if (c == 'draw') $('.nvui button.draw-yes').click();
else if (c == 'takeback') $('.nvui button.takeback-yes').click();
else {
const pieces = ctrl.chessground.state.pieces;
notify(
commands.piece.apply(c, pieces, style) ||
commands.scan.apply(c, pieces) ||
`Invalid command: ${c}`
);
}
}