diff --git a/unity-client/Assets/Scripts/Models/SimStatusModel.cs b/unity-client/Assets/Scripts/Models/SimStatusModel.cs new file mode 100644 index 0000000..f672d1a --- /dev/null +++ b/unity-client/Assets/Scripts/Models/SimStatusModel.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace CommanderAILab.Models +{ + /// Maps to StartResponse from /api/lab/start. + [Serializable] + public class SimStartResponse + { + [JsonProperty("batchId")] public string batchId; + [JsonProperty("status")] public string status; + [JsonProperty("message")] public string message; + + public override string ToString() => $"Batch {batchId}: {status}"; + } + + /// Maps to StatusResponse from /api/lab/status/{id}. + [Serializable] + public class SimStatusModel + { + [JsonProperty("batchId")] public string batchId; + [JsonProperty("running")] public bool running; + [JsonProperty("completed")] public int completed; + [JsonProperty("total")] public int total; + [JsonProperty("threads")] public int threads; + [JsonProperty("elapsedMs")] public int elapsedMs; + [JsonProperty("error")] public string error; + [JsonProperty("simsPerSec")] public float simsPerSec; + [JsonProperty("run_id")] public string runId; + [JsonProperty("games_completed")] public int gamesCompleted; + [JsonProperty("total_games")] public int totalGames; + [JsonProperty("current_decks")] public List currentDecks; + + public override string ToString() => $"Batch {batchId}: {completed}/{total} ({(running ? "running" : "done")})"; + } +}