Add IGameLifecycle (#1287)

This commit is contained in:
MidoriKami 2023-06-24 23:36:58 -07:00 committed by GitHub
parent 8a6269c178
commit 0ac5c240f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 10 deletions

View file

@ -0,0 +1,24 @@
using System.Threading;
namespace Dalamud.Plugin.Services;
/// <summary>
/// Class offering cancellation tokens for common gameplay events.
/// </summary>
public interface IGameLifecycle
{
/// <summary>
/// Gets a token that is cancelled when Dalamud is unloading.
/// </summary>
public CancellationToken DalamudUnloadingToken { get; }
/// <summary>
/// Gets a token that is cancelled when the game is shutting down.
/// </summary>
public CancellationToken GameShuttingDownToken { get; }
/// <summary>
/// Gets a token that is cancelled when a character is logging out.
/// </summary>
public CancellationToken LogoutToken { get; }
}