Browse Source

rename RemoveEntitiesGroup into DeleteEntityGroup

add SimpleSubmissionEntityViewScheduler for testing purposes
tags/Rel2b2
sebas77 6 years ago
parent
commit
32b86d9fc8
6 changed files with 44 additions and 18 deletions
  1. +9
    -6
      Svelto.ECS.csproj
  2. +3
    -3
      Svelto.ECS/EnginesRootEntities.cs
  3. +0
    -7
      Svelto.ECS/IEngine.cs
  4. +1
    -2
      Svelto.ECS/IEnginesInterfaces.cs
  5. +9
    -0
      Svelto.ECS/IQueryingEntityViewEngine.cs
  6. +22
    -0
      Svelto.ECS/SimpleSubmissionEntityViewScheduler.cs

+ 9
- 6
Svelto.ECS.csproj View File

@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Svelto.ECS.Tests</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Reflection" Version="4.3.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
@@ -13,11 +12,15 @@
<PackageReference Include="System.Reflection.Primitives" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Reflection.Emit.Lightweight">
<HintPath>C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Emit.Lightweight.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
<ItemGroup>
<ProjectReference Include="..\Svelto.Common\Svelto.Common.csproj">
<Project>{6341571A-7DFB-43F5-BAAA-27357750D9E9}</Project>
<Name>Svelto.Common</Name>
</ProjectReference>
</ItemGroup>
</Project>

+ 3
- 3
Svelto.ECS/EnginesRootEntities.cs View File

@@ -159,7 +159,7 @@ namespace Svelto.ECS
InternalRemoveFromDBAndEngines(((EntityDescriptorInfo) EntityDescriptorTemplate<T>.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<T>(entityID);
}

public void RemoveGroupedEntities(int groupID)
public void DeleteEntityGroup(int groupID)
{
_weakReference.Target.RemoveEntitiesGroup(groupID);
_weakReference.Target.DeleteEntityGroup(groupID);
}

public void SwapEntityGroup<T>(int entityID, int fromGroupID, int toGroupID) where T : IEntityDescriptor, new()


+ 0
- 7
Svelto.ECS/IEngine.cs View File

@@ -11,11 +11,4 @@ namespace Svelto.ECS
{
public interface IEngine
{}
public interface IQueryingEntityViewEngine : IEngine
{
IEntityViewsDB entityViewsDB { set; }

void Ready();
}
}

+ 1
- 2
Svelto.ECS/IEnginesInterfaces.cs View File

@@ -22,8 +22,7 @@ namespace Svelto.ECS

void RemoveEntityFromGroup<T>(int entityID, int groupID) where T:IEntityDescriptor, new();
void RemoveGroupedEntities(int groupID);

void DeleteEntityGroup(int groupID);
void SwapEntityGroup<T>(int entityID, int fromGroupID, int toGroupID) where T : IEntityDescriptor, new();
}
}

+ 9
- 0
Svelto.ECS/IQueryingEntityViewEngine.cs View File

@@ -0,0 +1,9 @@
namespace Svelto.ECS
{
public interface IQueryingEntityViewEngine : IEngine
{
IEntityViewsDB entityViewsDB { set; }

void Ready();
}
}

+ 22
- 0
Svelto.ECS/SimpleSubmissionEntityViewScheduler.cs View File

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

Loading…
Cancel
Save