remove unnecessary lookup checks
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
20d382f51a
commit
df4a953628
|
@ -29,7 +29,6 @@ namespace Encompass
|
||||||
|
|
||||||
private TypedComponentStore<TComponent> Lookup<TComponent>() where TComponent : struct
|
private TypedComponentStore<TComponent> Lookup<TComponent>() where TComponent : struct
|
||||||
{
|
{
|
||||||
RegisterComponentType<TComponent>();
|
|
||||||
return _stores[typeof(TComponent)] as TypedComponentStore<TComponent>;
|
return _stores[typeof(TComponent)] as TypedComponentStore<TComponent>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +39,7 @@ namespace Encompass
|
||||||
|
|
||||||
public bool Has(Type type, int entityID)
|
public bool Has(Type type, int entityID)
|
||||||
{
|
{
|
||||||
return _stores.ContainsKey(type) && _stores[type].Has(entityID);
|
return _stores[type].Has(entityID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BitSet512 EntityBitArray(int entityID)
|
public BitSet512 EntityBitArray(int entityID)
|
||||||
|
|
|
@ -408,6 +408,10 @@ namespace Encompass
|
||||||
var method = typeof(WorldBuilder).GetMethod("RegisterComponentType", BindingFlags.NonPublic | BindingFlags.Instance);
|
var method = typeof(WorldBuilder).GetMethod("RegisterComponentType", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||||
var generic = method.MakeGenericMethod(componentType);
|
var generic = method.MakeGenericMethod(componentType);
|
||||||
generic.Invoke(this, null);
|
generic.Invoke(this, null);
|
||||||
|
|
||||||
|
var dummyRegisterMethod = typeof(ComponentManager).GetMethod("RegisterComponentType", BindingFlags.Public | BindingFlags.Instance);
|
||||||
|
var dummyGeneric = dummyRegisterMethod.MakeGenericMethod(componentType);
|
||||||
|
dummyGeneric.Invoke(dummyComponentManager, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (componentType.GetInterface("IDrawableComponent") != null)
|
if (componentType.GetInterface("IDrawableComponent") != null)
|
||||||
|
|
Loading…
Reference in New Issue