using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using static Serein.Library.Utils.ChannelFlowInterrupt;
namespace Serein.Library
{
///
/// 节点调试设置,用于中断节点的运行
///
[NodeProperty(ValuePath = NodeValuePath.DebugSetting)]
public partial class NodeDebugSetting
{
private readonly NodeModelBase nodeModel;
///
/// 创建属于某个节点的调试设置
///
///
public NodeDebugSetting(NodeModelBase nodeModel)
{
this.nodeModel = nodeModel;
}
///
/// 是否使能
///
[PropertyInfo(IsNotification = true)]
private bool _isEnable = true;
///
/// 中断级别,暂时停止继续执行后继分支。
///
[PropertyInfo]
private InterruptClass _interruptClass = InterruptClass.None;
///
/// 中断级别,暂时停止继续执行后继分支。
///
[PropertyInfo(IsNotification = true)]
private bool _isInterrupt = false;
///
/// 取消中断的回调函数
///
[PropertyInfo]
private Action _cancelInterruptCallback;
///
/// 中断Task(用来中断)
///
[PropertyInfo]
private Func> _getInterruptTask;
}
///
/// 中断级别,暂时停止继续执行后继分支。
///
public enum InterruptClass
{
///
/// 不中断
///
None,
///
/// 分支中断,中断进入当前节点的分支。
///
Branch,
///
/// 全局中断,中断全局所有节点的运行。(暂未实现相关)
///
Global,
}
}