You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using System;
|
|
using CleverCrow.Fluid.BTs.Tasks;
|
|
|
|
namespace Game
|
|
{
|
|
public partial class AIObjectBase<T> where T : new()
|
|
{
|
|
protected enum ETaskStatus
|
|
{
|
|
Success,
|
|
Failure,
|
|
Continue
|
|
}
|
|
|
|
protected void Selector(Action action)
|
|
{
|
|
Selector("selector", action);
|
|
}
|
|
|
|
protected void Selector(string name, Action action)
|
|
{
|
|
_builder.Selector(name);
|
|
action();
|
|
_builder.End();
|
|
}
|
|
|
|
protected void Sequence(Action action)
|
|
{
|
|
Sequence("sequence", action);
|
|
}
|
|
|
|
protected void Sequence(string name, Action action)
|
|
{
|
|
_builder.Sequence(name);
|
|
action();
|
|
_builder.End();
|
|
}
|
|
|
|
protected void Do(string name, Func<ETaskStatus> action)
|
|
{
|
|
_builder.Do(name, () => (TaskStatus)action());
|
|
}
|
|
|
|
protected void Condition(string name, Func<bool> action)
|
|
{
|
|
_builder.Condition(name, action);
|
|
}
|
|
}
|
|
} |