add IEcsPool.AddEmpty

This commit is contained in:
DCFApixels 2024-11-12 16:31:31 +08:00
parent 13d0d41966
commit 90c2b5fbd0
3 changed files with 10 additions and 1 deletions

View File

@ -259,6 +259,7 @@ namespace DCFApixels.DragonECS
#endregion
#region Other
void IEcsPool.AddEmpty(int entityID) { Add(entityID); }
void IEcsPool.AddRaw(int entityID, object dataRaw)
{
Add(entityID) = dataRaw == null ? default : (T)dataRaw;

View File

@ -88,6 +88,12 @@ namespace DCFApixels.DragonECS.Internal
{
#if (DEBUG && !DISABLE_DEBUG)
throw new NullInstanceException();
#endif
}
void IEcsPool.AddEmpty(int entityID)
{
#if (DEBUG && !DISABLE_DEBUG)
throw new NullInstanceException();
#endif
}
void IEcsPool.AddRaw(int entityID, object dataRaw)
@ -101,7 +107,7 @@ namespace DCFApixels.DragonECS.Internal
#if (DEBUG && !DISABLE_DEBUG)
throw new NullInstanceException();
#else
return null;
return null;
#endif
}
void IEcsPool.SetRaw(int entity, object dataRaw)
@ -179,6 +185,7 @@ namespace DCFApixels.DragonECS
public interface IEcsPool : IEcsReadonlyPool
{
#region Methods
void AddEmpty(int entityID);
void AddRaw(int entityID, object dataRaw);
void SetRaw(int entityID, object dataRaw);
void Del(int entityID);

View File

@ -224,6 +224,7 @@ namespace DCFApixels.DragonECS
#endregion
#region Other
void IEcsPool.AddEmpty(int entityID) { Add(entityID); }
void IEcsPool.AddRaw(int entityID, object dataRaw) { Add(entityID); }
object IEcsReadonlyPool.GetRaw(int entityID)
{