Traveller/scripts/behaviorTree/behavior/PatrolBehaviorTree.cs

36 lines
1.1 KiB
C#
Raw Normal View History

2024-04-28 13:55:19 +00:00
using ColdMint.scripts.behaviorTree.ai;
using ColdMint.scripts.character;
namespace ColdMint.scripts.behaviorTree.behavior;
/// <summary>
/// <para>Represents a behavior tree for patrol</para>
/// <para>表示巡逻的行为树</para>
/// </summary>
public class PatrolBehaviorTree : BehaviorTreeTemplate
{
public AiCharacter? Character { get; set; }
2024-04-28 13:55:19 +00:00
protected override IBehaviorTreeNode CreateRoot()
{
var patrolNode = new AiPatrolNode();
var aiWalkNode = new AiWalkNode();
var aiRotorNode = new AiRotorNode();
var aIPickNode = new AiPickNode();
var aiAttackNode = new AiAttackNode();
2024-04-28 13:55:19 +00:00
aiWalkNode.Character = Character;
patrolNode.Character = Character;
aiRotorNode.Character = Character;
aIPickNode.Character = Character;
aiAttackNode.Character = Character;
patrolNode.AddChild(aiWalkNode);
patrolNode.AddChild(aiRotorNode);
patrolNode.AddChild(aIPickNode);
patrolNode.AddChild(aiAttackNode);
return patrolNode;
}
protected override string CreateId()
2024-04-28 13:55:19 +00:00
{
return Config.BehaviorTreeId.Patrol;
}
}