【m】框架大更新
This commit is contained in:
@@ -68,23 +68,23 @@ namespace Stary.Evo
|
||||
mArchitecture.IOCInitClass();
|
||||
// 调用
|
||||
OnRegisterPatch?.Invoke(mArchitecture);
|
||||
|
||||
|
||||
// 初始化 Data
|
||||
for (int i = 0; i < mArchitecture.mDatas.Count; i++)
|
||||
{
|
||||
mArchitecture.mDatas[i].Init();
|
||||
}
|
||||
// 清空 Data
|
||||
// 清空 Data
|
||||
//mArchitecture.mDatas.Clear();
|
||||
|
||||
|
||||
|
||||
|
||||
// 初始化 System
|
||||
for (int i = 0; i < mArchitecture.mSystems.Count; i++)
|
||||
{
|
||||
mArchitecture.mSystems[i].Init();
|
||||
}
|
||||
// 清空 System
|
||||
|
||||
// 清空 System
|
||||
//mArchitecture.mSystems.Clear();
|
||||
mArchitecture.mInited = true;
|
||||
}
|
||||
@@ -225,6 +225,8 @@ namespace Stary.Evo
|
||||
command.Execute();
|
||||
}
|
||||
|
||||
#region EnumEventSystem
|
||||
|
||||
private EnumEventSystem _mEnumEventSystem = new EnumEventSystem();
|
||||
|
||||
/// <summary>
|
||||
@@ -384,6 +386,181 @@ namespace Stary.Evo
|
||||
_mEnumEventSystem.UnRegister(key, onEvent);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region StringEventSystem
|
||||
|
||||
private StringEventSystem _mStringEventSystem = new StringEventSystem();
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent(string key)
|
||||
{
|
||||
_mStringEventSystem.Send(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent<Tvalue1>(string key, Tvalue1 value) where Tvalue1 : class
|
||||
{
|
||||
_mStringEventSystem.Send(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent<Tvalue1, Tvalue2>(string key, Tvalue1 value1, Tvalue2 value2)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
{
|
||||
_mStringEventSystem.Send(key, value1, value2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent<Tvalue1, Tvalue2, Tvalue3>(string key, Tvalue1 value1, Tvalue2 value2, Tvalue3 value3)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
where Tvalue3 : class
|
||||
{
|
||||
_mStringEventSystem.Send(key, value1, value2, value3);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent(string key, object[] values)
|
||||
{
|
||||
_mStringEventSystem.Send(key, values);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent(string key, Action onEvent)
|
||||
{
|
||||
return _mStringEventSystem.Register(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent<Tvalue1>(string key, Action<Tvalue1> onEvent)
|
||||
where Tvalue1 : class
|
||||
{
|
||||
return _mStringEventSystem.Register(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent<Tvalue1, Tvalue2>(string key, Action<Tvalue1, Tvalue2> onEvent)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
{
|
||||
return _mStringEventSystem.Register(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent<Tvalue1, Tvalue2, Tvalue3>(string key, Action<Tvalue1, Tvalue2, Tvalue3> onEvent)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
where Tvalue3 : class
|
||||
{
|
||||
return _mStringEventSystem.Register(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent(string key, Action<object[]> onEvent)
|
||||
{
|
||||
return _mStringEventSystem.Register(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent(string key, Action onEvent)
|
||||
{
|
||||
_mStringEventSystem.UnRegister(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent<Tvalue1>(string key, Action<Tvalue1> onEvent)
|
||||
where Tvalue1 : class
|
||||
{
|
||||
_mStringEventSystem.UnRegister(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent<Tvalue1, Tvalue2>(string key, Action<Tvalue1, Tvalue2> onEvent)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
{
|
||||
_mStringEventSystem.UnRegister(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent<Tvalue1, Tvalue2, Tvalue3>(string key, Action<Tvalue1, Tvalue2, Tvalue3> onEvent)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
where Tvalue3 : class
|
||||
{
|
||||
_mStringEventSystem.UnRegister(key, onEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent(string key, Action<object[]> onEvent)
|
||||
{
|
||||
_mStringEventSystem.UnRegister(key, onEvent);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public TResult SendQuery<TResult>(IQuery<TResult> query)
|
||||
{
|
||||
return DoQuery<TResult>(query);
|
||||
|
||||
@@ -168,6 +168,129 @@ namespace Stary.Evo
|
||||
public void UnRegisterEvent<TEvent>(TEvent key, Action<object[]> onEvent) where TEvent : IConvertible;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent(string key);
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent<Tvalue1>(string key, Tvalue1 value) where Tvalue1 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent<Tvalue1, Tvalue2>(string key, Tvalue1 value1, Tvalue2 value2)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent<Tvalue1, Tvalue2, Tvalue3>(string key, Tvalue1 value1, Tvalue2 value2, Tvalue3 value3)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
where Tvalue3 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件发送
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void SendEvent(string key, object[] values);
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent(string key, Action onEvent);
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent<Tvalue1>(string key, Action<Tvalue1> onEvent)
|
||||
where Tvalue1 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent<Tvalue1, Tvalue2>(string key, Action<Tvalue1, Tvalue2> onEvent)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent<Tvalue1, Tvalue2, Tvalue3>(string key,
|
||||
Action<Tvalue1, Tvalue2, Tvalue3> onEvent)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
where Tvalue3 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件监听
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
public IUnRegister RegisterEvent(string key, Action<object[]> onEvent);
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent(string key, Action onEvent);
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent<Tvalue1>(string key, Action<Tvalue1> onEvent) where Tvalue1 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent<Tvalue1, Tvalue2>(string key, Action<Tvalue1, Tvalue2> onEvent)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent<Tvalue1, Tvalue2, Tvalue3>(string key, Action<Tvalue1, Tvalue2, Tvalue3> onEvent)
|
||||
where Tvalue1 : class
|
||||
where Tvalue2 : class
|
||||
where Tvalue3 : class;
|
||||
|
||||
/// <summary>
|
||||
/// 事件销毁
|
||||
/// </summary>
|
||||
/// <param name="onEvent"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public void UnRegisterEvent(string key, Action<object[]> onEvent);
|
||||
|
||||
|
||||
TResult SendQuery<TResult>(IQuery<TResult> query);
|
||||
|
||||
void OnDispose();
|
||||
|
||||
Reference in New Issue
Block a user