框架上传

This commit is contained in:
2025-03-31 11:16:52 +08:00
parent 7197b4c0d0
commit ffcdddbd2a
429 changed files with 19115 additions and 1579 deletions

View File

@@ -0,0 +1,7 @@
namespace Stary.Evo
{
public interface IBelongToArchitecture
{
IArchitecture GetArchitecture();
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 29267e7525d5442b8656b4c7e32d46db
timeCreated: 1624936941

View File

@@ -0,0 +1,14 @@
namespace Stary.Evo
{
public interface ICanGetData: IBelongToArchitecture
{
}
public static class CanGetDataExtension
{
public static T GetData<T>(this ICanGetData self) where T : class, IData
{
return self.GetArchitecture().GetData<T>();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1a8db07c697b49dfb467b3adb719f864
timeCreated: 1625107407

View File

@@ -0,0 +1,16 @@
using UnityEngine;
namespace Stary.Evo
{
public interface ICanGetSystem: IBelongToArchitecture
{
}
public static class CanGetSystemExtension
{
public static T GetSystem<T>(this ICanGetSystem self) where T : class, ISystem
{
return self.GetArchitecture().GetSystem<T>();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 98fef7169f2540d883fef0f3b57e7597
timeCreated: 1625109288

View File

@@ -0,0 +1,14 @@
namespace Stary.Evo
{
public interface ICanGetUtility: IBelongToArchitecture
{
}
public static class CanGetUtilityExtension
{
public static T GetUtility<T>(this ICanGetUtility self) where T : class, IUtility
{
return self.GetArchitecture().GetUtility<T>();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ac4506dbc33147408207becd4084b9e4
timeCreated: 1625107159

View File

@@ -0,0 +1,67 @@
using System;
namespace Stary.Evo
{
public interface ICanRegisterEvent:IBelongToArchitecture
{
}
public static class CanRegisterEventExtension
{
public static IUnRegister RegisterEvent<T>(this ICanRegisterEvent self,T key,Action onEvent) where T : IConvertible
{
return self.GetArchitecture().RegisterEvent(key,onEvent);
}
public static IUnRegister RegisterEvent<T,T1>(this ICanRegisterEvent self,T key,Action<T1> onEvent) where T : IConvertible
{
return self.GetArchitecture().RegisterEvent(key,onEvent);
}
public static IUnRegister RegisterEvent<T,T1,T2>(this ICanRegisterEvent self,T key,Action<T1,T2> onEvent) where T : IConvertible
{
return self.GetArchitecture().RegisterEvent(key,onEvent);
}
public static IUnRegister RegisterEvent<T,T1,T2,T3>(this ICanRegisterEvent self,T key,Action<T1,T3> onEvent) where T : IConvertible
{
return self.GetArchitecture().RegisterEvent(key,onEvent);
}
public static IUnRegister RegisterEvent<T>(this ICanRegisterEvent self,T key,Action<object[]> onEvent) where T : IConvertible
{
return self.GetArchitecture().RegisterEvent(key,onEvent);
}
public static void UnRegisterEvent<T>(this ICanRegisterEvent self,T key,Action onEvent) where T : IConvertible
{
self.GetArchitecture().UnRegisterEvent(key,onEvent);
}
public static void UnRegisterEvent<T,T1>(this ICanRegisterEvent self,T key,Action<T1> onEvent) where T : IConvertible
{
self.GetArchitecture().UnRegisterEvent(key,onEvent);
}
public static void UnRegisterEvent<T,T1,T2>(this ICanRegisterEvent self,T key,Action<T1,T2> onEvent) where T : IConvertible
{
self.GetArchitecture().UnRegisterEvent(key,onEvent);
}
public static void UnRegisterEvent<T,T1,T2,T3>(this ICanRegisterEvent self,T key,Action<T1,T3> onEvent) where T : IConvertible
{
self.GetArchitecture().UnRegisterEvent(key,onEvent);
}
public static void UnRegisterEvent<T>(this ICanRegisterEvent self,T key,Action<object[]> onEvent) where T : IConvertible
{
self.GetArchitecture().UnRegisterEvent(key,onEvent);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3afca6ed153c4f35bfbe630644c9bdab
timeCreated: 1625124335

View File

@@ -0,0 +1,21 @@
using UnityEngine;
namespace Stary.Evo
{
public interface ICanSendCommand: IBelongToArchitecture
{
}
public static class CanSendCommandExtension
{
public static void SendCommand<T>(this ICanSendCommand self) where T :class, ICommand, new()
{
self.GetArchitecture().SendCommand<T>();
}
public static void SendCommand<T>(this ICanSendCommand self,T command) where T : ICommand
{
self.GetArchitecture().SendCommand<T>(command);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7d4d286b9072404a9d1eed529797d37b
timeCreated: 1625109500

View File

@@ -0,0 +1,39 @@
using System;
namespace Stary.Evo
{
public interface ICanSendEvent:IBelongToArchitecture
{
}
public static class CanSendEventExtension
{
public static void SendEvent<T>(this ICanSendEvent self,T key) where T : IConvertible
{
self.GetArchitecture().SendEvent(key);
}
public static void SendEvent<T,T1>(this ICanSendEvent self,T key,T1 value) where T : IConvertible
{
self.GetArchitecture().SendEvent(key,value);
}
public static void SendEvent<T,T1,T2>(this ICanSendEvent self,T key,T1 value1,T2 value2) where T : IConvertible
{
self.GetArchitecture().SendEvent(key,value1,value2);
}
public static void SendEvent<T,T1,T2,T3>(this ICanSendEvent self,T key,T1 value1,T2 value2,T3 value3) where T : IConvertible
{
self.GetArchitecture().SendEvent(key,value1,value2, value3);
}
public static void SendEvent<T>(this ICanSendEvent self,T key,object[] values) where T : IConvertible
{
self.GetArchitecture().SendEvent(key,values);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0d5b249bb8554780a126cbe5d7189165
timeCreated: 1625124323

View File

@@ -0,0 +1,16 @@
namespace Stary.Evo
{
public interface ICanSendQuery : IBelongToArchitecture
{
}
public static class CanSendQueryExtension
{
public static T SendQuery<T>(this ICanSendQuery self, IQuery<T> query)
{
return self.GetArchitecture().SendQuery(query);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 435afd9942e6ed5409bb08b235b4dc03
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
namespace Stary.Evo
{
public interface ICanSetArchitecture
{
void SetArchitecture(IArchitecture architecture);
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1d30432f9f834aab87ee534ecc6e3fa4
timeCreated: 1625018433