com.alicizax.unity.framework/Runtime/Procedure/IProcedureService.cs

28 lines
896 B
C#
Raw Normal View History

2025-11-18 16:15:11 +08:00
using System;
using System.Collections.Generic;
namespace AlicizaX
{
public interface IProcedureService : IService, IServiceTickable
2025-11-18 16:15:11 +08:00
{
Type CurrentProcedureType { get; }
void InitializeProcedure(IEnumerable<IProcedure> availableProcedures, Type defaultProcedureType);
2025-11-18 16:15:11 +08:00
void ClearAllProcedures();
bool ContainsProcedure(Type procedureType);
bool TrySwitchProcedure(Type procedureType);
}
public static class ProcedureServiceExtensions
{
public static bool SwitchProcedure<T>(this IProcedureService procedureService) where T : IProcedure
{
return procedureService.TrySwitchProcedure(typeof(T));
}
public static bool SwitchProcedure(this IProcedureService procedureService, Type procedureType)
{
return procedureService.TrySwitchProcedure(procedureType);
}
2025-11-18 16:15:11 +08:00
}
}