Files
XRLib/Assets/Scripts/UVC/UI/Commands/ICommand.cs
2025-07-28 19:59:35 +09:00

22 lines
637 B
C#

#nullable enable
namespace UVC.UI.Commands
{
public interface ICommand
{
void Execute(object? parameter = null);
}
public interface ICommand<T> : ICommand
{
void Execute(T parameter);
void Execute()
{
// CS8604: T가 참조형이고 null이 허용되지 않을 때 경고가 발생하므로,
// T가 null 허용 타입이거나 값 타입일 때만 default(T)를 전달합니다.
// 그렇지 않으면, 명시적으로 default(T)를 전달하되, T가 null 허용 타입임을 명시합니다.
Execute(default(T)!);
}
}
}