feat : add stockfish 16.1
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { isWasmSupported } from "@/lib/engine/shared";
|
||||
import { Stockfish11 } from "@/lib/engine/stockfish11";
|
||||
import { Stockfish16 } from "@/lib/engine/stockfish16";
|
||||
import { Stockfish16_1 } from "@/lib/engine/stockfish16_1";
|
||||
import { UciEngine } from "@/lib/engine/uciEngine";
|
||||
import { EngineName } from "@/types/enums";
|
||||
import { useEffect, useState } from "react";
|
||||
@@ -10,7 +12,7 @@ export const useEngine = (engineName: EngineName | undefined) => {
|
||||
useEffect(() => {
|
||||
if (!engineName) return;
|
||||
|
||||
if (engineName.includes("stockfish_16") && !Stockfish16.isSupported()) {
|
||||
if (engineName !== EngineName.Stockfish11 && !isWasmSupported()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -29,13 +31,15 @@ export const useEngine = (engineName: EngineName | undefined) => {
|
||||
|
||||
const pickEngine = (engine: EngineName): UciEngine => {
|
||||
switch (engine) {
|
||||
case EngineName.Stockfish16_1:
|
||||
return new Stockfish16_1(false);
|
||||
case EngineName.Stockfish16_1Lite:
|
||||
return new Stockfish16_1(true);
|
||||
case EngineName.Stockfish16:
|
||||
return new Stockfish16(false);
|
||||
case EngineName.Stockfish16NNUE:
|
||||
return new Stockfish16(true);
|
||||
case EngineName.Stockfish11:
|
||||
return new Stockfish11();
|
||||
default:
|
||||
throw new Error(`Engine ${engine} does not exist ?!`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user