using System.Collections.Generic;
using Framework.ProcessMode;
using Newtonsoft.Json;
namespace DefaultNamespace.ProcessMode
{
///
/// 主流程
///
public class ProcessStep
{
public string StepDescription { get; set; } // 步骤描述
public List Actions { get; private set; } // 动作列表
public bool IsCompleted { get; set; } // 是否已经完成
public int StepNumber { get; set; }// 步骤编号
///
/// 步骤得分
///
[JsonProperty("Score")]
public float Score { get; set; } // 步骤得分
///
/// 默认构造函数,用于JSON反序列化
///
public ProcessStep()
{
StepDescription = "";
Actions = new List();
IsCompleted = false;
StepNumber = 0;
Score = 0.0f;
}
public ProcessStep(string stepDescription, List actions)
{
StepDescription = stepDescription;
Actions = actions;
IsCompleted = false;
Score = 0.0f; // 默认步骤得分为0
}
///
/// 带分数的构造函数
///
/// 步骤描述
/// 动作列表
/// 步骤得分
public ProcessStep(string stepDescription, List actions, float score)
{
StepDescription = stepDescription;
Actions = actions;
IsCompleted = false;
Score = score;
}
public void PlayAnimation(int index)
{
if (index >= 0 && index < Actions.Count)
{
Actions[index].Action?.Invoke(); // 执行动画
}
}
}
}