chess-easy
Version:
Chess engine that makes writing chessgame easier than writing a calculator
18 lines • 808 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MoveIndexes = void 0;
const utils_1 = require("../utils");
class MoveIndexes {
constructor(from, to) {
const [from_column, from_row] = from.split("");
const [to_column, to_row] = to.split("");
const from_column_index = (0, utils_1.mapLetterToColumnIndex)(from_column);
const from_row_index = Number(from_row) - 1;
const to_column_index = (0, utils_1.mapLetterToColumnIndex)(to_column);
const to_row_index = Number(to_row) - 1;
this.from = { column: from_column_index, row: from_row_index, field: from };
this.to = { column: to_column_index, row: to_row_index, field: to };
}
}
exports.MoveIndexes = MoveIndexes;
//# sourceMappingURL=MoveIndexes.js.map