diff --git a/Svelto.ECS.csproj b/Svelto.ECS.csproj index c06df04..23d1e71 100644 --- a/Svelto.ECS.csproj +++ b/Svelto.ECS.csproj @@ -1,9 +1,8 @@ - - + netstandard2.0 + Svelto.ECS.Tests - @@ -13,11 +12,15 @@ - C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Emit.Lightweight.dll - - + + + {6341571A-7DFB-43F5-BAAA-27357750D9E9} + Svelto.Common + + + \ No newline at end of file diff --git a/Svelto.ECS/EnginesRootEntities.cs b/Svelto.ECS/EnginesRootEntities.cs index d4ee5da..e1d7d1d 100644 --- a/Svelto.ECS/EnginesRootEntities.cs +++ b/Svelto.ECS/EnginesRootEntities.cs @@ -159,7 +159,7 @@ namespace Svelto.ECS InternalRemoveFromDBAndEngines(((EntityDescriptorInfo) EntityDescriptorTemplate.Default).entityViewsToBuild, entityID, _groupEntityViewsDB[groupID]); } - void RemoveEntitiesGroup(int groupID) + void DeleteEntityGroup(int groupID) { foreach (var group in _groupEntityViewsDB[groupID]) { @@ -364,9 +364,9 @@ namespace Svelto.ECS _weakReference.Target.RemoveEntity(entityID); } - public void RemoveGroupedEntities(int groupID) + public void DeleteEntityGroup(int groupID) { - _weakReference.Target.RemoveEntitiesGroup(groupID); + _weakReference.Target.DeleteEntityGroup(groupID); } public void SwapEntityGroup(int entityID, int fromGroupID, int toGroupID) where T : IEntityDescriptor, new() diff --git a/Svelto.ECS/IEngine.cs b/Svelto.ECS/IEngine.cs index 98597d5..7cca317 100644 --- a/Svelto.ECS/IEngine.cs +++ b/Svelto.ECS/IEngine.cs @@ -11,11 +11,4 @@ namespace Svelto.ECS { public interface IEngine {} - - public interface IQueryingEntityViewEngine : IEngine - { - IEntityViewsDB entityViewsDB { set; } - - void Ready(); - } } diff --git a/Svelto.ECS/IEnginesInterfaces.cs b/Svelto.ECS/IEnginesInterfaces.cs index 19e935d..d6203e1 100644 --- a/Svelto.ECS/IEnginesInterfaces.cs +++ b/Svelto.ECS/IEnginesInterfaces.cs @@ -22,8 +22,7 @@ namespace Svelto.ECS void RemoveEntityFromGroup(int entityID, int groupID) where T:IEntityDescriptor, new(); - void RemoveGroupedEntities(int groupID); - + void DeleteEntityGroup(int groupID); void SwapEntityGroup(int entityID, int fromGroupID, int toGroupID) where T : IEntityDescriptor, new(); } } diff --git a/Svelto.ECS/IQueryingEntityViewEngine.cs b/Svelto.ECS/IQueryingEntityViewEngine.cs new file mode 100644 index 0000000..441bdc3 --- /dev/null +++ b/Svelto.ECS/IQueryingEntityViewEngine.cs @@ -0,0 +1,9 @@ +namespace Svelto.ECS +{ + public interface IQueryingEntityViewEngine : IEngine + { + IEntityViewsDB entityViewsDB { set; } + + void Ready(); + } +} \ No newline at end of file diff --git a/Svelto.ECS/SimpleSubmissionEntityViewScheduler.cs b/Svelto.ECS/SimpleSubmissionEntityViewScheduler.cs new file mode 100644 index 0000000..57d3b97 --- /dev/null +++ b/Svelto.ECS/SimpleSubmissionEntityViewScheduler.cs @@ -0,0 +1,22 @@ +using Svelto.ECS.Schedulers; +using Svelto.WeakEvents; + +namespace Svelto.ECS +{ + //This scheduler shouldn't be used in production and it's meant to be + //used for Unit Tests only + public class SimpleSubmissionEntityViewScheduler : EntitySubmissionScheduler + { + public void SubmitEntities() + { + _submitEntityViews.Invoke(); + } + + public override void Schedule(WeakAction submitEntityViews) + { + _submitEntityViews = submitEntityViews; + } + + WeakAction _submitEntityViews; + } +} \ No newline at end of file