IAwake.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. namespace Model
  3. {
  4. public abstract class AAwakeSystem
  5. {
  6. public abstract Type Type();
  7. public virtual void Run(object o){ }
  8. public virtual void Run(object o, object a) { }
  9. public virtual void Run(object o, object a, object b) { }
  10. public virtual void Run(object o, object a, object b, object c) { }
  11. }
  12. public abstract class AwakeSystem<T> : AAwakeSystem
  13. {
  14. public override Type Type()
  15. {
  16. return typeof(T);
  17. }
  18. public override void Run(object o)
  19. {
  20. this.Awake((T)o);
  21. }
  22. public abstract void Awake(T self);
  23. }
  24. public abstract class AwakeSystem<T, A> : AAwakeSystem
  25. {
  26. public override Type Type()
  27. {
  28. return typeof(T);
  29. }
  30. public override void Run(object o, object a)
  31. {
  32. this.Awake((T)o, (A)a);
  33. }
  34. public abstract void Awake(T self, A a);
  35. }
  36. public abstract class AwakeSystem<T, A, B> : AAwakeSystem
  37. {
  38. public override Type Type()
  39. {
  40. return typeof(T);
  41. }
  42. public override void Run(object o, object a, object b)
  43. {
  44. this.Awake((T)o, (A)a, (B)b);
  45. }
  46. public abstract void Awake(T self, A a, B b);
  47. }
  48. public abstract class AwakeSystem<T, A, B, C> : AAwakeSystem
  49. {
  50. public override Type Type()
  51. {
  52. return typeof(T);
  53. }
  54. public override void Run(object o, object a, object b, object c)
  55. {
  56. this.Awake((T)o, (A)a, (B)b, (C)c);
  57. }
  58. public abstract void Awake(T self, A a, B b, C c);
  59. }
  60. }