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."); } }
public bool Has(object key) { return(Chunk.GetIndexInTypeArray(key.FetchTypeIndex()) != -1); }
public bool HasComponentData <T>() where T : struct, IComponentData { var typeIndex = TypeManager.GetTypeIndex <T>(); return(Chunk.GetIndexInTypeArray(typeIndex) != -1); }
public bool HasData <T>() where T : struct { var index = TypeManager.GetTypeIndex <T>(); return(Chunk.GetIndexInTypeArray(index) != -1); }