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),
});
