//
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
namespace MUnique.OpenMU.GameLogic.PlugIns.PeriodicTasks;
///
/// Game server state per event.
///
public class PeriodicTaskGameServerState
{
///
/// Initializes a new instance of the class.
///
/// The context.
public PeriodicTaskGameServerState(IGameContext context)
{
this.Context = context;
}
///
/// Gets the context to which this state belongs.
///
public IGameContext Context { get; }
///
/// Gets or sets the next run in UTC.
///
public DateTime NextRunUtc { get; set; } = DateTime.UtcNow;
///
/// Gets or sets the UTC timestamp of when the last event run started.
/// Used to prevent a new event from starting before the previous task duration has elapsed.
///
public DateTime LastRunUtc { get; set; } = DateTime.MinValue;
///
/// Gets or sets the state.
///
public PeriodicTaskState State { get; set; } = PeriodicTaskState.NotStarted;
///
/// Gets the description about the state.
///
public virtual string Description => string.Empty;
}