feat : add stockfish 16.1

This commit is contained in:
GuillaumeSD
2024-09-30 02:01:07 +02:00
parent 2baf9b76ad
commit 94b7c9d9f7
25 changed files with 110 additions and 47 deletions

View File

@@ -0,0 +1,23 @@
import { EngineName } from "@/types/enums";
import { UciEngine } from "./uciEngine";
import { isMultiThreadSupported, isWasmSupported } from "./shared";
export class Stockfish16_1 extends UciEngine {
constructor(lite?: boolean) {
if (!isWasmSupported()) {
throw new Error("Stockfish 16.1 is not supported");
}
const multiThreadIsSupported = isMultiThreadSupported();
if (!multiThreadIsSupported) console.log("Single thread mode");
const enginePath = `engines/stockfish-16.1/stockfish-16.1${
lite ? "-lite" : ""
}${multiThreadIsSupported ? "" : "-single"}.js`;
super(
lite ? EngineName.Stockfish16_1Lite : EngineName.Stockfish16_1,
enginePath
);
}
}