39 lines
881 B
C#
39 lines
881 B
C#
using Godot;
|
|
|
|
namespace ColdMint.scripts.stateMachine;
|
|
|
|
/// <summary>
|
|
/// <para>StateProcessorTemplate</para>
|
|
/// <para>状态处理器模板</para>
|
|
/// </summary>
|
|
public abstract class StateProcessorTemplate : IStateProcessor
|
|
{
|
|
public void Enter(StateContext context)
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
public void Execute(StateContext context)
|
|
{
|
|
if (context.Owner == null)
|
|
{
|
|
return;
|
|
}
|
|
OnExecute(context, context.Owner);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>When executed</para>
|
|
/// <para>当执行时</para>
|
|
/// </summary>
|
|
/// <param name="context"></param>
|
|
/// <param name="owner"></param>
|
|
protected abstract void OnExecute(StateContext context, Node owner);
|
|
|
|
public void Exit(StateContext context)
|
|
{
|
|
|
|
}
|
|
|
|
public abstract State State { get; }
|
|
} |