Notify about campaign start
This commit is contained in:
@ -15,16 +15,33 @@ namespace Hcs.WebApp.BackgroundServices.CampaignManagers
|
||||
protected readonly ResultWaitState resultWaitState = resultWaitState;
|
||||
protected readonly Campaign campaign = campaign;
|
||||
|
||||
private IManager.ManagerState state;
|
||||
private HeadquartersService? headquartersService;
|
||||
|
||||
public Campaign Campaign => campaign;
|
||||
|
||||
public IManager.ManagerState State
|
||||
{
|
||||
get => state;
|
||||
set
|
||||
{
|
||||
if (state != value)
|
||||
{
|
||||
state = value;
|
||||
|
||||
if (state == IManager.ManagerState.Started)
|
||||
{
|
||||
OnCampaignStarted?.Invoke(campaign);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected HeadquartersService HeadquartersService => headquartersService ??= scope.ServiceProvider.GetRequiredService<HeadquartersService>();
|
||||
|
||||
protected abstract int StepCount { get; }
|
||||
|
||||
public Campaign Campaign => campaign;
|
||||
|
||||
public IManager.ManagerState State { get; protected set; } = IManager.ManagerState.Created;
|
||||
|
||||
public event Action<Campaign> OnCampaignStarted;
|
||||
public event Action<Campaign>? OnCampaignProgressStep;
|
||||
|
||||
public abstract Task ProcessAsync();
|
||||
|
||||
Reference in New Issue
Block a user