mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-09-18 01:44:35 +08:00
simple refactoring
This commit is contained in:
parent
5ba5b7094d
commit
67fb791544
@ -31,39 +31,39 @@ namespace DCFApixels.DragonECS
|
||||
}
|
||||
|
||||
#region IEcsAspectExtensions tmp
|
||||
// public static class IEcsAspectExtensions
|
||||
// {
|
||||
// public static void Apply(this IEcsAspect aspect, short worldID, int entityID)
|
||||
// {
|
||||
// EcsWorld world = EcsWorld.GetWorld(worldID);
|
||||
// EcsMask mask = aspect.Mask;
|
||||
// foreach (var incTypeID in mask._incs)
|
||||
// {
|
||||
// var pool = world.FindPoolInstance(incTypeID);
|
||||
// if (pool != null)
|
||||
// {
|
||||
// if (pool.Has(entityID) == false)
|
||||
// {
|
||||
// pool.AddEmpty(entityID);
|
||||
// }
|
||||
// }
|
||||
//#if DEBUG
|
||||
// else
|
||||
// {
|
||||
// EcsDebug.PrintWarning("Component has not been added because the pool has not been initialized yet.");
|
||||
// }
|
||||
//#endif
|
||||
// }
|
||||
// foreach (var excTypeID in mask._excs)
|
||||
// {
|
||||
// var pool = world.FindPoolInstance(excTypeID);
|
||||
// if (pool != null && pool.Has(entityID))
|
||||
// {
|
||||
// pool.Del(entityID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// public static class IEcsAspectExtensions
|
||||
// {
|
||||
// public static void Apply(this IEcsAspect aspect, short worldID, int entityID)
|
||||
// {
|
||||
// EcsWorld world = EcsWorld.GetWorld(worldID);
|
||||
// EcsMask mask = aspect.Mask;
|
||||
// foreach (var incTypeID in mask._incs)
|
||||
// {
|
||||
// var pool = world.FindPoolInstance(incTypeID);
|
||||
// if (pool != null)
|
||||
// {
|
||||
// if (pool.Has(entityID) == false)
|
||||
// {
|
||||
// pool.AddEmpty(entityID);
|
||||
// }
|
||||
// }
|
||||
//#if DEBUG
|
||||
// else
|
||||
// {
|
||||
// EcsDebug.PrintWarning("Component has not been added because the pool has not been initialized yet.");
|
||||
// }
|
||||
//#endif
|
||||
// }
|
||||
// foreach (var excTypeID in mask._excs)
|
||||
// {
|
||||
// var pool = world.FindPoolInstance(excTypeID);
|
||||
// if (pool != null && pool.Has(entityID))
|
||||
// {
|
||||
// pool.Del(entityID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
#endregion
|
||||
|
||||
public static partial class API
|
||||
@ -227,7 +227,7 @@ namespace DCFApixels.DragonECS
|
||||
//Building
|
||||
TAspect newAspect = new TAspect();
|
||||
EcsAspect builtinAspect = newAspect as EcsAspect;
|
||||
if(builtinAspect != null)
|
||||
if (builtinAspect != null)
|
||||
{
|
||||
builtinAspect._source = world;
|
||||
builtinAspect.Init(builder);
|
||||
@ -244,7 +244,7 @@ namespace DCFApixels.DragonECS
|
||||
}
|
||||
}
|
||||
EcsMask mask = staticMask.ToMask(world);
|
||||
if(builtinAspect != null)
|
||||
if (builtinAspect != null)
|
||||
{
|
||||
builtinAspect._mask = mask;
|
||||
//var pools = new IEcsPool[builder._poolsBufferCount];
|
||||
|
@ -377,7 +377,7 @@ namespace DCFApixels.DragonECS
|
||||
}
|
||||
finally
|
||||
{
|
||||
if(pair.runFinally != null)
|
||||
if (pair.runFinally != null)
|
||||
{
|
||||
translationFinnalyCallback(pair.runFinally);
|
||||
}
|
||||
|
@ -8,8 +8,8 @@ namespace DCFApixels.DragonECS
|
||||
{
|
||||
public partial class EcsWorld
|
||||
{
|
||||
private SparseArray<int> _poolTypeCode_2_CmpTypeIDs = new SparseArray<int>();
|
||||
private SparseArray<int> _cmpTypeCode_2_CmpTypeIDs = new SparseArray<int>();
|
||||
private readonly SparseArray<int> _poolTypeCode_2_CmpTypeIDs = new SparseArray<int>();
|
||||
private readonly SparseArray<int> _cmpTypeCode_2_CmpTypeIDs = new SparseArray<int>();
|
||||
|
||||
internal IEcsPoolImplementation[] _pools;
|
||||
internal PoolSlot[] _poolSlots;
|
||||
|
Loading…
Reference in New Issue
Block a user