mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-06 13:19:31 -05:00
29 lines
705 B
TypeScript
29 lines
705 B
TypeScript
import * as React from "react";
|
|
import type {
|
|
BuildAbilitiesTupleWithUnknown,
|
|
MainWeaponId,
|
|
} from "../in-game-lists";
|
|
import { buildStats } from "./stats";
|
|
|
|
export function useAnalyzeBuild() {
|
|
const [build, setBuild] = React.useState<BuildAbilitiesTupleWithUnknown>([
|
|
["UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN"],
|
|
["UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN"],
|
|
["UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN"],
|
|
]);
|
|
const [weaponId, setWeaponId] = React.useState<MainWeaponId>(0);
|
|
|
|
const analyzed = React.useMemo(
|
|
() => buildStats({ build, weaponSplId: weaponId }),
|
|
[build, weaponId]
|
|
);
|
|
|
|
return {
|
|
build,
|
|
setBuild,
|
|
weaponId,
|
|
setWeaponId,
|
|
analyzed,
|
|
};
|
|
}
|