Mirror of Svelto.ECS because we're a fan of it
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

130 wiersze
4.4KB

  1. using Svelto.ECS.Internal;
  2. namespace Svelto.ECS
  3. {
  4. public abstract class GenericEntityDescriptor<T>: IEntityDescriptor
  5. where T : struct, _IInternalEntityComponent
  6. {
  7. static readonly IComponentBuilder[] _componentBuilders;
  8. static GenericEntityDescriptor()
  9. {
  10. _componentBuilders = new IComponentBuilder[]
  11. {
  12. new ComponentBuilder<T>()
  13. };
  14. }
  15. public IComponentBuilder[] componentsToBuild => _componentBuilders;
  16. }
  17. public abstract class GenericEntityDescriptor<T, U>: IEntityDescriptor
  18. where T : struct, _IInternalEntityComponent
  19. where U : struct, _IInternalEntityComponent
  20. {
  21. static readonly IComponentBuilder[] _componentBuilders;
  22. static GenericEntityDescriptor()
  23. {
  24. _componentBuilders = new IComponentBuilder[]
  25. {
  26. new ComponentBuilder<T>(),
  27. new ComponentBuilder<U>()
  28. };
  29. }
  30. public IComponentBuilder[] componentsToBuild => _componentBuilders;
  31. }
  32. public abstract class GenericEntityDescriptor<T, U, V>: IEntityDescriptor
  33. where T : struct, _IInternalEntityComponent
  34. where U : struct, _IInternalEntityComponent
  35. where V : struct, _IInternalEntityComponent
  36. {
  37. static readonly IComponentBuilder[] _componentBuilders;
  38. static GenericEntityDescriptor()
  39. {
  40. _componentBuilders = new IComponentBuilder[]
  41. {
  42. new ComponentBuilder<T>(),
  43. new ComponentBuilder<U>(),
  44. new ComponentBuilder<V>()
  45. };
  46. }
  47. public IComponentBuilder[] componentsToBuild => _componentBuilders;
  48. }
  49. public abstract class GenericEntityDescriptor<T, U, V, W>: IEntityDescriptor
  50. where T : struct, _IInternalEntityComponent
  51. where U : struct, _IInternalEntityComponent
  52. where V : struct, _IInternalEntityComponent
  53. where W : struct, _IInternalEntityComponent
  54. {
  55. static readonly IComponentBuilder[] _componentBuilders;
  56. static GenericEntityDescriptor()
  57. {
  58. _componentBuilders = new IComponentBuilder[]
  59. {
  60. new ComponentBuilder<T>(),
  61. new ComponentBuilder<U>(),
  62. new ComponentBuilder<V>(),
  63. new ComponentBuilder<W>()
  64. };
  65. }
  66. public IComponentBuilder[] componentsToBuild => _componentBuilders;
  67. }
  68. public abstract class GenericEntityDescriptor<T, U, V, W, X>: IEntityDescriptor
  69. where T : struct, _IInternalEntityComponent
  70. where U : struct, _IInternalEntityComponent
  71. where V : struct, _IInternalEntityComponent
  72. where W : struct, _IInternalEntityComponent
  73. where X : struct, _IInternalEntityComponent
  74. {
  75. static readonly IComponentBuilder[] _componentBuilders;
  76. static GenericEntityDescriptor()
  77. {
  78. _componentBuilders = new IComponentBuilder[]
  79. {
  80. new ComponentBuilder<T>(),
  81. new ComponentBuilder<U>(),
  82. new ComponentBuilder<V>(),
  83. new ComponentBuilder<W>(),
  84. new ComponentBuilder<X>()
  85. };
  86. }
  87. public IComponentBuilder[] componentsToBuild => _componentBuilders;
  88. }
  89. public abstract class GenericEntityDescriptor<T, U, V, W, X, Y>: IEntityDescriptor
  90. where T : struct, _IInternalEntityComponent
  91. where U : struct, _IInternalEntityComponent
  92. where V : struct, _IInternalEntityComponent
  93. where W : struct, _IInternalEntityComponent
  94. where X : struct, _IInternalEntityComponent
  95. where Y : struct, _IInternalEntityComponent
  96. {
  97. static readonly IComponentBuilder[] _componentBuilders;
  98. static GenericEntityDescriptor()
  99. {
  100. _componentBuilders = new IComponentBuilder[]
  101. {
  102. new ComponentBuilder<T>(),
  103. new ComponentBuilder<U>(),
  104. new ComponentBuilder<V>(),
  105. new ComponentBuilder<W>(),
  106. new ComponentBuilder<X>(),
  107. new ComponentBuilder<Y>()
  108. };
  109. }
  110. public IComponentBuilder[] componentsToBuild => _componentBuilders;
  111. }
  112. }