move sanToRole to keyboardMove
parent
6855d74abb
commit
4a71499265
|
@ -33,15 +33,6 @@ export const roleToSan = {
|
|||
king: 'K'
|
||||
};
|
||||
|
||||
export const sanToRole: { [key: string]: 'pawn' | 'knight' | 'bishop' | 'rook' | 'queen' | 'king' } = {
|
||||
P: 'pawn',
|
||||
N: 'knight',
|
||||
B: 'bishop',
|
||||
R: 'rook',
|
||||
Q: 'queen',
|
||||
K: 'king'
|
||||
};
|
||||
|
||||
export const altCastles = {
|
||||
e1a1: 'e1c1',
|
||||
e1h1: 'e1g1',
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { h } from 'snabbdom'
|
||||
import { sanToRole } from 'chess'
|
||||
import * as cg from 'chessground/types';
|
||||
import { Step, Redraw } from './interfaces';
|
||||
import RoundController from './ctrl';
|
||||
|
@ -27,6 +26,15 @@ export interface KeyboardMove {
|
|||
clock(): ClockController | undefined;
|
||||
}
|
||||
|
||||
const sanToRole: { [key: string]: cg.Role } = {
|
||||
P: 'pawn',
|
||||
N: 'knight',
|
||||
B: 'bishop',
|
||||
R: 'rook',
|
||||
Q: 'queen',
|
||||
K: 'king',
|
||||
};
|
||||
|
||||
export function ctrl(root: RoundController, step: Step, redraw: Redraw): KeyboardMove {
|
||||
let focus = false;
|
||||
let handler: KeyboardMoveHandler | undefined;
|
||||
|
|
Loading…
Reference in New Issue