2025-05-04 21:39:09 -05:00
|
|
|
import type { TankDefinition } from '@blitzkit/core';
|
|
|
|
|
import { create } from 'zustand';
|
|
|
|
|
import { createContextualStore } from '../core/zustand/createContextualStore';
|
|
|
|
|
|
|
|
|
|
export interface GuessEphemeral {
|
|
|
|
|
tank: TankDefinition;
|
|
|
|
|
// true = correct, false = incorrect, null = not guessed
|
|
|
|
|
guessState: boolean | null;
|
2025-05-04 21:45:38 -05:00
|
|
|
totalGuesses: number;
|
|
|
|
|
correctGuesses: number;
|
2025-05-04 21:39:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const GuessEphemeral = createContextualStore((tank: TankDefinition) =>
|
|
|
|
|
create<GuessEphemeral>()(() => ({
|
|
|
|
|
tank,
|
|
|
|
|
guessState: null,
|
2025-05-04 21:45:38 -05:00
|
|
|
totalGuesses: 0,
|
|
|
|
|
correctGuesses: 0,
|
2025-05-04 21:39:09 -05:00
|
|
|
})),
|
|
|
|
|
);
|