using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Serein.Flow
{
public enum DynamicNodeType
{
///
/// 初始化
///
Init,
///
/// 开始载入
///
Loading,
///
/// 结束
///
Exit,
///
/// 触发器
///
Flipflop,
///
/// 条件节点
///
Condition,
///
/// 动作节点
///
Action,
}
///
/// 用来判断一个类是否需要注册并构建实例(单例模式场景使用)
///
[AttributeUsage(AttributeTargets.Class)]
public class DynamicFlowAttribute(bool scan = true) : Attribute
{
public bool Scan { get; set; } = scan;
}
///
/// 标记一个方法是什么类型,加载dll后用来拖拽到画布中
///
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public class MethodDetailAttribute(DynamicNodeType methodDynamicType,
string methodTips = "",
bool scan = true,
string lockName = "") : Attribute
{
public bool Scan { get; set; } = scan;
public string MethodTips { get; } = methodTips;
public DynamicNodeType MethodDynamicType { get; } = methodDynamicType;
public string LockName { get; } = lockName;
}
///
/// 是否为显式参数
///
[AttributeUsage(AttributeTargets.Parameter)]
public class ExplicitAttribute : Attribute // where TEnum : Enum
{
}
}