From d059a24aecf19cdfd0a7ba87b5e25af2ec30169b Mon Sep 17 00:00:00 2001 From: sebas77 Date: Tue, 18 Sep 2018 13:36:16 +0100 Subject: [PATCH] Remove SwapFirstEntityGroup, it may have created misunderstanding and it's not strictly needed. --- Svelto.ECS/EnginesRoot.Entities.cs | 7 ------- Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs | 12 ------------ Svelto.ECS/EnginesRoot.Submission.cs | 3 --- Svelto.ECS/EntitySubmitOperation.cs | 1 - Svelto.ECS/IEntityFunctions.cs | 4 +--- 5 files changed, 1 insertion(+), 26 deletions(-) diff --git a/Svelto.ECS/EnginesRoot.Entities.cs b/Svelto.ECS/EnginesRoot.Entities.cs index 6ab2db9..5716d6f 100644 --- a/Svelto.ECS/EnginesRoot.Entities.cs +++ b/Svelto.ECS/EnginesRoot.Entities.cs @@ -200,13 +200,6 @@ namespace Svelto.ECS MoveEntity(builders, new EGID(entityID, fromGroupID), toGroupID, toGroup); } - void SwapFirstEntityInGroup(IEntityBuilder[] builders, int fromGroupID, int toGroupId) - { - var firstID = _groupEntityDB[fromGroupID][builders[0].GetEntityType()].GetFirstID(); - - SwapEntityGroup(builders, firstID, fromGroupID, toGroupId); - } - readonly EntitiesDB _DB; int _newEntitiesBuiltToProcess; } diff --git a/Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs b/Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs index 3631613..6260a4f 100644 --- a/Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs +++ b/Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs @@ -69,18 +69,6 @@ namespace Svelto.ECS _weakReference.Target.QueueEntitySubmitOperation( new EntitySubmitOperation(EntitySubmitOperationType.Swap, id.entityID, id.groupID, (int)toGroupID, EntityDescriptorTemplate.descriptor.entitiesToBuild)); } - - public void SwapFirstEntityGroup(int fromGroupID, int toGroupID) where T : IEntityDescriptor, new() - { - _weakReference.Target.QueueEntitySubmitOperation( - new EntitySubmitOperation(EntitySubmitOperationType.FirstSwap, -1, fromGroupID, toGroupID, EntityDescriptorTemplate.descriptor.entitiesToBuild)); - } - - public void SwapFirstEntityGroup(ExclusiveGroup fromGroupID, ExclusiveGroup toGroupID) where T : IEntityDescriptor, new() - { - _weakReference.Target.QueueEntitySubmitOperation( - new EntitySubmitOperation(EntitySubmitOperationType.FirstSwap, -1, (int)fromGroupID, (int)toGroupID, EntityDescriptorTemplate.descriptor.entitiesToBuild)); - } } void QueueEntitySubmitOperation(EntitySubmitOperation entitySubmitOperation) diff --git a/Svelto.ECS/EnginesRoot.Submission.cs b/Svelto.ECS/EnginesRoot.Submission.cs index 1972459..7aaa2c1 100644 --- a/Svelto.ECS/EnginesRoot.Submission.cs +++ b/Svelto.ECS/EnginesRoot.Submission.cs @@ -27,9 +27,6 @@ namespace Svelto.ECS case EntitySubmitOperationType.Remove: MoveEntity(entitiesOperations[i].builders, new EGID(entitiesOperations[i].id, entitiesOperations[i].fromGroupID)); break; - case EntitySubmitOperationType.FirstSwap: - SwapFirstEntityInGroup(entitiesOperations[i].builders, entitiesOperations[i].fromGroupID, entitiesOperations[i].toGroupID); - break; case EntitySubmitOperationType.RemoveGroup: RemoveGroupAndEntitiesFromDB(entitiesOperations[i].fromGroupID); break; diff --git a/Svelto.ECS/EntitySubmitOperation.cs b/Svelto.ECS/EntitySubmitOperation.cs index 2ba472b..02d151b 100644 --- a/Svelto.ECS/EntitySubmitOperation.cs +++ b/Svelto.ECS/EntitySubmitOperation.cs @@ -22,7 +22,6 @@ { Swap, Remove, - FirstSwap, RemoveGroup } } \ No newline at end of file diff --git a/Svelto.ECS/IEntityFunctions.cs b/Svelto.ECS/IEntityFunctions.cs index 9de15e6..1dee968 100644 --- a/Svelto.ECS/IEntityFunctions.cs +++ b/Svelto.ECS/IEntityFunctions.cs @@ -5,7 +5,7 @@ namespace Svelto.ECS public interface IEntityFunctions { //being entity ID globally not unique, the group must be specified when - //an entity is removed. Not specificing the group will attempt to remove + //an entity is removed. Not specifying the group will attempt to remove //the entity from the special standard group. void RemoveEntity(int entityID, int groupID) where T : IEntityDescriptor, new(); void RemoveEntity(int entityID, ExclusiveGroup groupID) where T : IEntityDescriptor, new(); @@ -18,7 +18,5 @@ namespace Svelto.ECS void SwapEntityGroup(int entityID, ExclusiveGroup fromGroupID, ExclusiveGroup toGroupID) where T : IEntityDescriptor, new(); void SwapEntityGroup(EGID id, int toGroupID) where T : IEntityDescriptor, new(); void SwapEntityGroup(EGID id, ExclusiveGroup toGroupID) where T : IEntityDescriptor, new(); - void SwapFirstEntityGroup(int fromGroupID, int toGroupID) where T : IEntityDescriptor, new(); - void SwapFirstEntityGroup(ExclusiveGroup fromGroupID, ExclusiveGroup toGroupID) where T : IEntityDescriptor, new(); } } \ No newline at end of file