NPC refactor (#10122)

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2022-09-06 00:28:23 +10:00
committed by GitHub
parent 138e328c04
commit 0286b88388
290 changed files with 13842 additions and 5939 deletions

View File

@@ -0,0 +1,31 @@
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;
}
}