Files
tbd-station-14/Content.Server/NPC/HTN/HTNPlan.cs
metalgearsloth 0286b88388 NPC refactor (#10122)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-09-06 00:28:23 +10:00

32 lines
829 B
C#

using Content.Server.NPC.HTN.PrimitiveTasks;
namespace Content.Server.NPC.HTN;
/// <summary>
/// The current plan for a HTN NPC.
/// </summary>
public sealed class HTNPlan
{
/// <summary>
/// Effects that were applied for each primitive task in the plan.
/// </summary>
public readonly List<Dictionary<string, object>?> Effects;
public List<int> BranchTraversalRecord;
public List<HTNPrimitiveTask> Tasks;
public int Index = 0;
public HTNPrimitiveTask CurrentTask => Tasks[Index];
public HTNOperator CurrentOperator => CurrentTask.Operator;
public HTNPlan(List<HTNPrimitiveTask> tasks, List<int> branchTraversalRecord, List<Dictionary<string, object>?> effects)
{
Tasks = tasks;
BranchTraversalRecord = branchTraversalRecord;
Effects = effects;
}
}