123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- using System;
- namespace ET
- {
- public interface IAwake
- {
- }
- public interface IAwake<A>
- {
- }
-
- public interface IAwake<A, B>
- {
- }
-
- public interface IAwake<A, B, C>
- {
- }
-
- public interface IAwake<A, B, C, D>
- {
- }
-
- public interface IAwakeSystem: ISystemType
- {
- void Run(Entity o);
- }
-
- public interface IAwakeSystem<A>: ISystemType
- {
- void Run(Entity o, A a);
- }
-
- public interface IAwakeSystem<A, B>: ISystemType
- {
- void Run(Entity o, A a, B b);
- }
-
- public interface IAwakeSystem<A, B, C>: ISystemType
- {
- void Run(Entity o, A a, B b, C c);
- }
-
- public interface IAwakeSystem<A, B, C, D>: ISystemType
- {
- void Run(Entity o, A a, B b, C c, D d);
- }
- [ObjectSystem]
- public abstract class AwakeSystem<T> : IAwakeSystem where T: Entity, IAwake
- {
- Type ISystemType.Type()
- {
- return typeof(T);
- }
- Type ISystemType.SystemType()
- {
- return typeof(IAwakeSystem);
- }
- InstanceQueueIndex ISystemType.GetInstanceQueueIndex()
- {
- return InstanceQueueIndex.None;
- }
- void IAwakeSystem.Run(Entity o)
- {
- this.Awake((T)o);
- }
- protected abstract void Awake(T self);
- }
-
- [ObjectSystem]
- public abstract class AwakeSystem<T, A> : IAwakeSystem<A> where T: Entity, IAwake<A>
- {
- Type ISystemType.Type()
- {
- return typeof(T);
- }
- Type ISystemType.SystemType()
- {
- return typeof(IAwakeSystem<A>);
- }
- InstanceQueueIndex ISystemType.GetInstanceQueueIndex()
- {
- return InstanceQueueIndex.None;
- }
- void IAwakeSystem<A>.Run(Entity o, A a)
- {
- this.Awake((T)o, a);
- }
- protected abstract void Awake(T self, A a);
- }
- [ObjectSystem]
- public abstract class AwakeSystem<T, A, B> : IAwakeSystem<A, B> where T: Entity, IAwake<A, B>
- {
- Type ISystemType.Type()
- {
- return typeof(T);
- }
- Type ISystemType.SystemType()
- {
- return typeof(IAwakeSystem<A, B>);
- }
- InstanceQueueIndex ISystemType.GetInstanceQueueIndex()
- {
- return InstanceQueueIndex.None;
- }
- void IAwakeSystem<A, B>.Run(Entity o, A a, B b)
- {
- this.Awake((T)o, a, b);
- }
- protected abstract void Awake(T self, A a, B b);
- }
- [ObjectSystem]
- public abstract class AwakeSystem<T, A, B, C> : IAwakeSystem<A, B, C> where T: Entity, IAwake<A, B, C>
- {
- Type ISystemType.Type()
- {
- return typeof(T);
- }
- Type ISystemType.SystemType()
- {
- return typeof(IAwakeSystem<A, B, C>);
- }
- InstanceQueueIndex ISystemType.GetInstanceQueueIndex()
- {
- return InstanceQueueIndex.None;
- }
- void IAwakeSystem<A, B, C>.Run(Entity o, A a, B b, C c)
- {
- this.Awake((T)o, a, b, c);
- }
- protected abstract void Awake(T self, A a, B b, C c);
- }
-
- [ObjectSystem]
- public abstract class AwakeSystem<T, A, B, C, D> : IAwakeSystem<A, B, C, D> where T: Entity, IAwake<A, B, C, D>
- {
- Type ISystemType.Type()
- {
- return typeof(T);
- }
- Type ISystemType.SystemType()
- {
- return typeof(IAwakeSystem<A, B, C, D>);
- }
- InstanceQueueIndex ISystemType.GetInstanceQueueIndex()
- {
- return InstanceQueueIndex.None;
- }
- void IAwakeSystem<A, B, C, D>.Run(Entity o, A a, B b, C c, D d)
- {
- this.Awake((T)o, a, b, c, d);
- }
- protected abstract void Awake(T self, A a, B b, C c, D d);
- }
- }
|