diff --git a/Svelto.Common b/Svelto.Common index b333fcd..a1f5f55 160000 --- a/Svelto.Common +++ b/Svelto.Common @@ -1 +1 @@ -Subproject commit b333fcd47178138a48602493fa21665ca95e1549 +Subproject commit a1f5f55c8b28f66ed033fa02c425dfa16c3c30e6 diff --git a/Svelto.ECS/DataStructures/TypeSafeDictionary.cs b/Svelto.ECS/DataStructures/TypeSafeDictionary.cs index e659df5..d7100c3 100644 --- a/Svelto.ECS/DataStructures/TypeSafeDictionary.cs +++ b/Svelto.ECS/DataStructures/TypeSafeDictionary.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Svelto.DataStructures; + using Svelto.DataStructures.Experimental; using Svelto.Utilities; namespace Svelto.ECS.Internal @@ -135,7 +136,9 @@ namespace Svelto.ECS.Internal public uint FindElementIndex(int entityGidEntityId) { uint findIndex; - if (FindIndex(entityGidEntityId, out findIndex) == false) throw new Exception(""); + if (FindIndex(entityGidEntityId, out findIndex) == false) + throw new Exception("Entity not found in this group"); + return findIndex; } diff --git a/Svelto.ECS/EntityViewsDB.cs b/Svelto.ECS/EntityViewsDB.cs index c994e43..66268ce 100644 --- a/Svelto.ECS/EntityViewsDB.cs +++ b/Svelto.ECS/EntityViewsDB.cs @@ -52,7 +52,7 @@ namespace Svelto.ECS.Internal return ((TypeSafeDictionary)typeSafeDictionary).GetFasterValuesBuffer(out count); } - public T[] QueryEntities(EGID entityGID, out uint index) where T : IEntityStruct + public T[] QueryEntitiesAndIndex(EGID entityGID, out uint index) where T : IEntityStruct { TypeSafeDictionary casted; if (!FindSafeDictionary(entityGID, out casted)) diff --git a/Svelto.ECS/IEntityViewsDB.cs b/Svelto.ECS/IEntityViewsDB.cs index 0a3b1cd..8e5bede 100644 --- a/Svelto.ECS/IEntityViewsDB.cs +++ b/Svelto.ECS/IEntityViewsDB.cs @@ -33,7 +33,7 @@ namespace Svelto.ECS //to use with EntityViews, EntityStructs and EntityViewStructs T[] QueryEntities(out int count) where T : IEntityStruct; T[] QueryEntities(int group, out int count) where T : IEntityStruct; - T[] QueryEntities(EGID entityGID, out uint index) where T : IEntityStruct; + T[] QueryEntitiesAndIndex(EGID entityGid, out uint index) where T : IEntityStruct; //to use with EntityViews, EntityStructs and EntityViewStructs void ExecuteOnEntity(EGID egid, ref W value, ActionRef action) where T : IEntityStruct;