/ GUNRPG.ClientModels / OperatorModels.cs
OperatorModels.cs
 1  namespace GUNRPG.ClientModels;
 2  
 3  /// <summary>
 4  /// Operator summary returned from GET /operators.
 5  /// </summary>
 6  public sealed class OperatorSummary
 7  {
 8      public Guid Id { get; init; }
 9      public string Name { get; init; } = string.Empty;
10      public string CurrentMode { get; init; } = "Base";
11      public bool IsDead { get; init; }
12      public long TotalXp { get; init; }
13      public float CurrentHealth { get; init; }
14      public float MaxHealth { get; init; }
15  }
16  
17  /// <summary>
18  /// Full operator state returned from GET /operators/{id}.
19  /// </summary>
20  public sealed class OperatorState
21  {
22      public Guid Id { get; init; }
23      public string Name { get; init; } = string.Empty;
24      public long TotalXp { get; init; }
25      public float CurrentHealth { get; init; }
26      public float MaxHealth { get; init; }
27      public string EquippedWeaponName { get; init; } = string.Empty;
28      public List<string> UnlockedPerks { get; init; } = new();
29      public int ExfilStreak { get; init; }
30      public bool IsDead { get; init; }
31      public string CurrentMode { get; init; } = "Base";
32      public DateTimeOffset? InfilStartTime { get; init; }
33      public Guid? InfilSessionId { get; init; }
34      public Guid? ActiveCombatSessionId { get; init; }
35      public CombatSession? ActiveCombatSession { get; init; }
36      public string LockedLoadout { get; init; } = string.Empty;
37      public PetState? Pet { get; init; }
38  
39      /// <summary>Approximate level derived from total XP (100 XP per level).</summary>
40      public int Level => TotalXp > 0 ? (int)(TotalXp / 100) + 1 : 1;
41  
42      /// <summary>True when the operator is deployed in the field (Infil mode).</summary>
43      public bool IsOnMission => CurrentMode == "Infil";
44  }
45  
46  /// <summary>
47  /// Response returned from POST /operators/{id}/infil/start.
48  /// </summary>
49  public sealed class StartInfilResponse
50  {
51      public Guid SessionId { get; init; }
52      public OperatorState Operator { get; init; } = null!;
53  }