Behaviour Tree
This commit is contained in:
19
Runtime/Engine/Code/AI/BehaviourTree.cs
Normal file
19
Runtime/Engine/Code/AI/BehaviourTree.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace RebootKit.Engine.AI {
|
||||
public class BehaviourTree : BehaviourNode {
|
||||
public BehaviourTree(string name) : base(name) {
|
||||
}
|
||||
|
||||
public override Status Process(float dt) {
|
||||
while (m_CurrentChild < Children.Count) {
|
||||
Status status = Children[m_CurrentChild].Process(dt);
|
||||
if (status != Status.Success) {
|
||||
return status;
|
||||
}
|
||||
|
||||
m_CurrentChild += 1;
|
||||
}
|
||||
|
||||
return Status.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user