This commit is contained in:
Maciej Caderek
2022-02-11 22:22:12 +01:00
parent d08080543d
commit db40aa2939
6 changed files with 51 additions and 7 deletions

View File

@@ -70,7 +70,21 @@ class Game {
loadFEN(fen: string) {
this.game = new Chess(fen);
this.positions = [];
this.positions = [
{
ply: 0,
move: null,
end: 0,
fen,
check: false,
mate: false,
turn: this.game.turn(),
material: this.materialInfo(this.game.board()),
placement: this.getPlacement(this.game.fen()),
last: true,
},
];
return this;
}
private getPlacement(fen: string) {