public static void AssertEntityHasComponent(this ArchetypeChunk chunk, int typeIndex)
 {
     if (chunk.GetIndexInTypeArray(typeIndex) == -1)
     {
         throw new ArgumentException($"A component with typeIndex:{typeIndex} has not been added to the entity.");
     }
     if (TypeManager.IsZeroSized(typeIndex))
     {
         throw new ArgumentException("GetComponentData can not be called with a zero sized component.");
     }
 }
Esempio n. 2
0
 public bool Has(object key)
 {
     return(Chunk.GetIndexInTypeArray(key.FetchTypeIndex()) != -1);
 }
Esempio n. 3
0
        public bool HasComponentData <T>() where T : struct, IComponentData
        {
            var typeIndex = TypeManager.GetTypeIndex <T>();

            return(Chunk.GetIndexInTypeArray(typeIndex) != -1);
        }
Esempio n. 4
0
        public bool HasData <T>() where T : struct
        {
            var index = TypeManager.GetTypeIndex <T>();

            return(Chunk.GetIndexInTypeArray(index) != -1);
        }