using System;
///
/// Replay JSON DTOs for admin-panel playback.
/// Playback contract:
/// 1. Advance playbackTime with real time (scaled).
/// 2. Binary-search frames by t; Hermite-interpolate x/y using vx/vy between neighbors.
/// 3. On reset/goal events (discontinuities): snap to the sample at/after t — do not blend across.
/// 4. Fire SFX on hit/goal when playbackTime crosses event t.
///
[Serializable]
public class ReplayFile
{
public int version = 1;
public int matchId;
/// True for localhost practice / tutorial host matches (no dedicated matchmaker id).
public bool isPractice;
public float fixedDeltaTime;
public float duration;
public ReplayEntity[] entities;
public ReplayFrame[] frames;
public ReplayEvent[] events;
}
[Serializable]
public class ReplayEntity
{
public int id;
/// "ball" or "puck"
public string type;
/// "Red", "Blue", or empty for ball
public string team;
}
[Serializable]
public class ReplayFrame
{
public float t;
public float[] x;
public float[] y;
public float[] vx;
public float[] vy;
}
[Serializable]
public class ReplayEvent
{
public float t;
/// "hit", "goal", or "reset"
public string type;
/// For hits: "puck_puck", "ball_puck", or "ball_wall"
public string kind;
public float vol;
/// Entity id for spatial cueing; -1 when N/A
public int id = -1;
/// For goals: conceding team ("Red"/"Blue")
public string team;
public int redScore;
public int blueScore;
public bool kickoff;
}