2025-11-18 16:15:11 +08:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace AlicizaX
|
|
|
|
|
{
|
2026-04-20 13:46:44 +08:00
|
|
|
public interface IProcedureService : IService
|
2025-11-18 16:15:11 +08:00
|
|
|
{
|
2026-03-31 17:25:20 +08:00
|
|
|
Type CurrentProcedureType { get; }
|
|
|
|
|
void InitializeProcedure(IEnumerable<IProcedure> availableProcedures, Type defaultProcedureType);
|
2025-11-18 16:15:11 +08:00
|
|
|
void ClearAllProcedures();
|
2026-03-31 17:25:20 +08:00
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|