@battle-racing/br-common-lib
Version:
Common library for all Battle Racing Repositorios
18 lines (13 loc) • 454 B
text/typescript
import { z } from 'zod';
import { GAME_TYPE } from '../Game.const';
import { gameKartStateSchema, gameSchema } from '../Game.schema';
// --- Helper Schemas ---
export const battleKartStateSchema = gameKartStateSchema.extend({
lives: z.number(),
});
// --- Main Battle Schema ---
export const battleSchema = gameSchema.extend({
type: z.literal(GAME_TYPE.Battle),
lives: z.number(),
kartsState: z.record(z.string(), battleKartStateSchema),
});