mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-22 12:09:34 +08:00

* 添加任务计划 * 复制物品、技能新增复制选项;修改游戏平衡常数 * 更新游戏平衡常数 --------- Co-authored-by: yeziuku <53083103+yeziuku@users.noreply.github.com>
36 lines
954 B
C#
36 lines
954 B
C#
namespace Milimoe.FunGame.Core.Model
|
|
{
|
|
public class RecurringTask(string name, TimeSpan interval, Action action)
|
|
{
|
|
/// <summary>
|
|
/// 任务名称
|
|
/// </summary>
|
|
public string Name { get; set; } = name;
|
|
|
|
/// <summary>
|
|
/// 循环执行间隔
|
|
/// </summary>
|
|
public TimeSpan Interval { get; set; } = interval;
|
|
|
|
/// <summary>
|
|
/// 任务执行逻辑
|
|
/// </summary>
|
|
public Action Action { get; set; } = action;
|
|
|
|
/// <summary>
|
|
/// 记录上一次运行时间
|
|
/// </summary>
|
|
public DateTime? LastRun { get; set; } = null;
|
|
|
|
/// <summary>
|
|
/// 记录下一次运行时间
|
|
/// </summary>
|
|
public DateTime NextRun { get; set; } = DateTime.MaxValue;
|
|
|
|
/// <summary>
|
|
/// 最后一次运行时发生的错误
|
|
/// </summary>
|
|
public Exception? Error { get; set; }
|
|
}
|
|
}
|