feat : add arrow opt out options
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
import { Stockfish16 } from "@/lib/engine/stockfish16";
|
||||
import { UciEngine } from "@/lib/engine/uciEngine";
|
||||
import { engineMultiPvAtom } from "@/sections/analysis/states";
|
||||
import { EngineName } from "@/types/enums";
|
||||
import { useAtomValue } from "jotai";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export const useEngine = (engineName: EngineName) => {
|
||||
const [engine, setEngine] = useState<UciEngine | null>(null);
|
||||
const multiPv = useAtomValue(engineMultiPvAtom);
|
||||
|
||||
const pickEngine = (engine: EngineName): UciEngine => {
|
||||
switch (engine) {
|
||||
case EngineName.Stockfish16:
|
||||
return new Stockfish16();
|
||||
return new Stockfish16(multiPv);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user