Files
plugin-library/Assets/00.StaryEvo/Runtime/Design/ICommand.cs
2025-03-31 11:16:52 +08:00

34 lines
795 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Stary.Evo
{
public interface ICommand : IBelongToArchitecture,ICanSetArchitecture,ICanGetSystem,ICanGetData,ICanGetUtility,ICanSendCommand,ICanSendEvent, ICanSendQuery
{
void Execute();
}
public abstract class AbstractCommand : ICommand
{
private IArchitecture mArchitecture;
IArchitecture IBelongToArchitecture.GetArchitecture()
{
return mArchitecture;
}
void ICanSetArchitecture.SetArchitecture(IArchitecture architecture)
{
mArchitecture = architecture;
}
void ICommand.Execute()
{
OnExecute();
}
protected abstract void OnExecute();
}
}