Browse Source

Remove SwapFirstEntityGroup, it may have created misunderstanding and it's not strictly needed.

tags/2.7
sebas77 6 years ago
parent
commit
d059a24aec
5 changed files with 1 additions and 26 deletions
  1. +0
    -7
      Svelto.ECS/EnginesRoot.Entities.cs
  2. +0
    -12
      Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs
  3. +0
    -3
      Svelto.ECS/EnginesRoot.Submission.cs
  4. +0
    -1
      Svelto.ECS/EntitySubmitOperation.cs
  5. +1
    -3
      Svelto.ECS/IEntityFunctions.cs

+ 0
- 7
Svelto.ECS/EnginesRoot.Entities.cs View File

@@ -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;
}


+ 0
- 12
Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs View File

@@ -69,18 +69,6 @@ namespace Svelto.ECS
_weakReference.Target.QueueEntitySubmitOperation(
new EntitySubmitOperation(EntitySubmitOperationType.Swap, id.entityID, id.groupID, (int)toGroupID, EntityDescriptorTemplate<T>.descriptor.entitiesToBuild));
}
public void SwapFirstEntityGroup<T>(int fromGroupID, int toGroupID) where T : IEntityDescriptor, new()
{
_weakReference.Target.QueueEntitySubmitOperation(
new EntitySubmitOperation(EntitySubmitOperationType.FirstSwap, -1, fromGroupID, toGroupID, EntityDescriptorTemplate<T>.descriptor.entitiesToBuild));
}

public void SwapFirstEntityGroup<T>(ExclusiveGroup fromGroupID, ExclusiveGroup toGroupID) where T : IEntityDescriptor, new()
{
_weakReference.Target.QueueEntitySubmitOperation(
new EntitySubmitOperation(EntitySubmitOperationType.FirstSwap, -1, (int)fromGroupID, (int)toGroupID, EntityDescriptorTemplate<T>.descriptor.entitiesToBuild));
}
}

void QueueEntitySubmitOperation(EntitySubmitOperation entitySubmitOperation)


+ 0
- 3
Svelto.ECS/EnginesRoot.Submission.cs View File

@@ -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;


+ 0
- 1
Svelto.ECS/EntitySubmitOperation.cs View File

@@ -22,7 +22,6 @@
{
Swap,
Remove,
FirstSwap,
RemoveGroup
}
}

+ 1
- 3
Svelto.ECS/IEntityFunctions.cs View File

@@ -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<T>(int entityID, int groupID) where T : IEntityDescriptor, new();
void RemoveEntity<T>(int entityID, ExclusiveGroup groupID) where T : IEntityDescriptor, new();
@@ -18,7 +18,5 @@ namespace Svelto.ECS
void SwapEntityGroup<T>(int entityID, ExclusiveGroup fromGroupID, ExclusiveGroup toGroupID) where T : IEntityDescriptor, new();
void SwapEntityGroup<T>(EGID id, int toGroupID) where T : IEntityDescriptor, new();
void SwapEntityGroup<T>(EGID id, ExclusiveGroup toGroupID) where T : IEntityDescriptor, new();
void SwapFirstEntityGroup<T>(int fromGroupID, int toGroupID) where T : IEntityDescriptor, new();
void SwapFirstEntityGroup<T>(ExclusiveGroup fromGroupID, ExclusiveGroup toGroupID) where T : IEntityDescriptor, new();
}
}

Loading…
Cancel
Save