Add Forced move classification (#19)

This commit is contained in:
titanium_machine
2025-05-08 00:48:58 +02:00
committed by GitHub
parent 8c934ab3b0
commit 4c5f953b7b
3 changed files with 10 additions and 0 deletions

BIN
public/icons/forced.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -29,6 +29,15 @@ export const getMovesClassification = (
}; };
} }
const prevPosition = rawPositions[index - 1];
if (prevPosition.bestMove && prevPosition.lines.length <= 1) {
return {
...rawPosition,
opening: currentOpening,
moveClassification: MoveClassification.Forced,
};
}
const playedMove = uciMoves[index - 1]; const playedMove = uciMoves[index - 1];
const bestMove = rawPositions[index - 1].bestMove; const bestMove = rawPositions[index - 1].bestMove;

View File

@@ -21,6 +21,7 @@ export enum MoveClassification {
Good = "good", Good = "good",
Excellent = "excellent", Excellent = "excellent",
Best = "best", Best = "best",
Forced = "forced",
Book = "book", Book = "book",
Great = "great", Great = "great",
Brilliant = "brilliant", Brilliant = "brilliant",