public ComponentArray <T> GetComponentArray <T>() { var r = componentArrays[ComponentTypeManager.GetTypeIndex <T>()]; if (r == null) { throw new ArgumentException($"Entity not contains component of type {typeof(T)}"); } return((ComponentArray <T>)r); }
public bool HasComponent <T>() { var typeId = ComponentTypeManager.GetTypeIndex <T>(); return(componentArrays.Length > typeId && componentArrays[typeId] != null); }