FunGame-Core/Library/Common/Event/GeneralEventArgs.cs
milimoe 082ce3b6f5
添加插件加载器和事件触发方法组 (#54)
* Add PluginLoader

* 删除event返回值

* 添加插件触发器(方法组)

* 删除冗余方法

* 将typeof(GetType())改写为this is

* 删除无用引用
2023-09-24 13:06:10 +08:00

30 lines
788 B
C#

namespace Milimoe.FunGame.Core.Library.Common.Event
{
public class GeneralEventArgs : EventArgs
{
public string EventMsg { get; set; } = "";
public object[] Parameters { get; set; } = Array.Empty<object>();
public bool Cancel { get; set; } = false;
public GeneralEventArgs(string EventMsg, object[] Parameters)
{
this.EventMsg = EventMsg;
this.Parameters = Parameters;
}
public GeneralEventArgs(params object[] Parameters)
{
this.Parameters = Parameters;
}
}
public class GeneralEvent<T>
{
public T? Instance { get; set; }
public GeneralEvent()
{
Instance = (T?)Activator.CreateInstance(typeof(T?));
}
}
}