Mirror of Svelto.ECS because we're a fan of it
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

20 líneas
625B

  1. using Svelto.Common;
  2. using Svelto.ECS.Hybrid;
  3. using Svelto.ECS.Internal;
  4. namespace Svelto.ECS
  5. {
  6. static class TypeSafeDictionaryFactory<T> where T : struct, _IInternalEntityComponent
  7. {
  8. static readonly bool isUnmanaged = TypeCache<T>.isUnmanaged
  9. && typeof(IEntityViewComponent).IsAssignableFrom(typeof(T)) == false;
  10. public static ITypeSafeDictionary Create(uint size)
  11. {
  12. if (isUnmanaged)
  13. return new UnmanagedTypeSafeDictionary<T>(size);
  14. return new ManagedTypeSafeDictionary<T>(size);
  15. }
  16. }
  17. }