59 lines
1.6 KiB
C#
59 lines
1.6 KiB
C#
using StandardScene.Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using static StandardScene.Chained.AbstractLoopMission;
|
|
|
|
namespace StandardScene.Chained.Loop
|
|
{
|
|
/// <summary>
|
|
/// 进入点规则:返回是否允许进入。
|
|
/// </summary>
|
|
public interface IEnterRule
|
|
{
|
|
bool CanEnter(LoopPoint point, LoopTask task, object context = null);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 离开点规则:返回是否允许离开。
|
|
/// </summary>
|
|
public interface IExitRule
|
|
{
|
|
bool CanExit(LoopPoint point, LoopTask task, object context = null);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 合流规则:从候选任务中选择一个
|
|
/// </summary>
|
|
public interface IJoinRule
|
|
{
|
|
LoopTask SelectJoin(IEnumerable<LoopTask> candidates, LoopPoint point);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 分流规则:为任务选取下一分支标识
|
|
/// </summary>
|
|
public interface IBranchRule
|
|
{
|
|
string SelectBranch(LoopPoint point, LoopTask task, object context = null);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 任务策略接口:提供任务数据来源与基础策略决策(由 LoopViewer 或其它组件实现/替换)。
|
|
/// </summary>
|
|
public interface ITaskStrategy
|
|
{
|
|
/// <summary>
|
|
/// 返回当前策略下的任务集合(策略负责数据来源,例如读取 LoopViewer 的 JSON)。
|
|
/// </summary>
|
|
IEnumerable<LoopTask> GetTasks();
|
|
|
|
/// <summary>
|
|
/// 刷新策略数据(例如重新加载 JSON)。
|
|
/// </summary>
|
|
void Refresh();
|
|
}
|
|
}
|