public EcsQuery Without <T> () where T : struct { var typeId = EcsComponentType <T> .GetIdInWorld(_world.Index); #if DEBUG if (typeId <= 0) { throw new Exception($"invalid query: \"{typeof (T).Name}\" component not registered in world."); } if (_include.Get(typeId) || _exclude.Get(typeId)) { throw new Exception($"Invalid query: \"{typeof (T).Name}\" constraint already used."); } #endif _exclude.Set(typeId); return(this); }
public EcsQuery With <T> () where T : struct { var typeId = EcsComponentType <T> .GetIdInWorld(_world.Index); #if DEBUG if (typeId <= 0) { throw new Exception($"invalid query: \"{typeof (T).Name}\" component not registered in world."); } if (_include.Get(typeId) || _exclude.Get(typeId)) { throw new Exception($"invalid query: \"{typeof (T).Name}\" constraint already used."); } #endif _include.Set(typeId); var pool = _world.Pools[typeId]; var poolCount = pool.Entities.GetCount(); if (poolCount < _entitiesCount) { _entities = pool.Entities; _entitiesCount = poolCount; } return(this); }
public override void UnregisterWorld(int worldId) { EcsComponentType <T> .Unregister(worldId); }