/ GUNRPG.Application / Backend / IGameBackend.cs
IGameBackend.cs
 1  namespace GUNRPG.Application.Backend;
 2  
 3  /// <summary>
 4  /// Abstraction for game backend operations.
 5  /// Online implementation uses HTTP API; offline implementation uses local LiteDB.
 6  /// Combat remains interactive and player-driven in both modes — this interface
 7  /// handles operator data access, not gameplay execution.
 8  /// </summary>
 9  public interface IGameBackend
10  {
11      /// <summary>
12      /// Gets the operator state by ID.
13      /// Returns null if the operator does not exist.
14      /// </summary>
15      Task<OperatorDto?> GetOperatorAsync(string id);
16  
17      /// <summary>
18      /// Infils the operator: takes a snapshot of current server state for offline use.
19      /// Only available in online mode.
20      /// </summary>
21      Task<OperatorDto> InfilOperatorAsync(string id);
22  
23      /// <summary>
24      /// Checks whether an operator with the given ID exists.
25      /// </summary>
26      Task<bool> OperatorExistsAsync(string id);
27  }