mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-11-13 17:15:54 +08:00
refactoring
This commit is contained in:
parent
e6adde2760
commit
8b0f463129
@ -82,7 +82,7 @@ namespace DCFApixels.DragonECS
|
|||||||
{
|
{
|
||||||
return _world.GetPool<TComponent, TPool>();
|
return _world.GetPool<TComponent, TPool>();
|
||||||
}
|
}
|
||||||
public void IncludeImplicit<TComponent>()
|
private void IncludeImplicit<TComponent>()
|
||||||
{
|
{
|
||||||
int id = _world.GetComponentID<TComponent>();
|
int id = _world.GetComponentID<TComponent>();
|
||||||
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS
|
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
@ -90,7 +90,7 @@ namespace DCFApixels.DragonECS
|
|||||||
#endif
|
#endif
|
||||||
_inc.Add(_world.GetComponentID<TComponent>());
|
_inc.Add(_world.GetComponentID<TComponent>());
|
||||||
}
|
}
|
||||||
public void ExcludeImplicit<TComponent>()
|
private void ExcludeImplicit<TComponent>()
|
||||||
{
|
{
|
||||||
int id = _world.GetComponentID<TComponent>();
|
int id = _world.GetComponentID<TComponent>();
|
||||||
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS
|
#if (DEBUG && !DISABLE_DEBUG) || !DISABLE_DRAGONECS_ASSERT_CHEKS
|
||||||
|
|||||||
@ -108,7 +108,8 @@ namespace DCFApixels.DragonECS
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetComponentID
|
#region GetComponentID
|
||||||
public int GetComponentID<T>() => WorldMetaStorage.GetComponentId<T>(_worldTypeID);////ComponentType<TWorldArchetype>.uniqueID;
|
public int GetComponentID<T>() => WorldMetaStorage.GetComponentId<T>(_worldTypeID);
|
||||||
|
public bool IsComponentTypeDeclared<T>() => WorldMetaStorage.IsComponentTypeDeclared<T>(_worldTypeID);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -380,7 +381,7 @@ namespace DCFApixels.DragonECS
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region WorldMetaStorage
|
#region WorldMetaStorage
|
||||||
public static class WorldMetaStorage
|
internal static class WorldMetaStorage
|
||||||
{
|
{
|
||||||
private static List<Resizer> _resizer = new List<Resizer>();
|
private static List<Resizer> _resizer = new List<Resizer>();
|
||||||
private static int _tokenCount = 0;
|
private static int _tokenCount = 0;
|
||||||
@ -421,6 +422,7 @@ namespace DCFApixels.DragonECS
|
|||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static int GetExecutorId<T>(int worldID) => Executor<T>.Get(worldID);
|
public static int GetExecutorId<T>(int worldID) => Executor<T>.Get(worldID);
|
||||||
|
|
||||||
|
public static bool IsComponentTypeDeclared<TComponent>(int worldID) => IsComponentTypeDeclared(worldID, typeof(TComponent));
|
||||||
public static bool IsComponentTypeDeclared(int worldID, Type type) => _metas[worldID].IsDeclaredType(type);
|
public static bool IsComponentTypeDeclared(int worldID, Type type) => _metas[worldID].IsDeclaredType(type);
|
||||||
public static Type GetComponentType(int worldID, int componentID) => _metas[worldID].GetComponentType(componentID);
|
public static Type GetComponentType(int worldID, int componentID) => _metas[worldID].GetComponentType(componentID);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user