Files
blitzkit/packages/website/src/stores/guess.ts
T

29 lines
628 B
TypeScript
Raw Normal View History

2025-09-01 19:22:38 -05:00
import type { TankDefinition } from "@blitzkit/core";
2026-01-04 15:11:20 -06:00
import { times } from "lodash-es";
2026-09-27 17:04:15 -05:00
import { Soapstone } from "soapstone";
2025-05-04 21:39:09 -05:00
2025-09-01 22:55:31 -05:00
export enum GuessState {
Correct,
Incorrect,
NotGuessed,
}
2025-09-01 19:22:38 -05:00
export interface Guess {
2025-05-04 21:39:09 -05:00
tank: TankDefinition;
2025-09-01 22:55:31 -05:00
guessState: GuessState;
2025-05-04 21:45:38 -05:00
totalGuesses: number;
correctGuesses: number;
2025-12-27 19:39:10 -06:00
streak: number;
2025-12-27 19:51:50 -06:00
helpingReveal: boolean;
2026-01-04 15:11:20 -06:00
tiers: number[];
2025-05-04 21:39:09 -05:00
}
2026-09-27 17:04:15 -05:00
export const Guess = new Soapstone<Guess, [TankDefinition]>((tank) => ({
2025-09-01 19:22:38 -05:00
tank,
2025-09-01 22:55:31 -05:00
guessState: GuessState.NotGuessed,
2025-09-01 19:22:38 -05:00
totalGuesses: 0,
correctGuesses: 0,
2025-12-27 19:39:10 -06:00
streak: 0,
2025-12-27 19:51:50 -06:00
helpingReveal: false,
2026-01-04 15:11:20 -06:00
tiers: times(10, (index) => index + 1),
2025-09-01 19:22:38 -05:00
}));