Browse Source

fixed nasty bug on new reactive engines

tags/2.8
sebas77 5 years ago
parent
commit
1e1f02349f
3 changed files with 6 additions and 6 deletions
  1. +4
    -4
      Svelto.ECS/EnginesRoot.Engines.cs
  2. +1
    -1
      Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs
  3. +1
    -1
      Svelto.ECS/EnginesRoot.Submission.cs

+ 4
- 4
Svelto.ECS/EnginesRoot.Engines.cs View File

@@ -47,10 +47,10 @@ namespace Svelto.ECS
try
{
if (engine is IReactOnAddAndRemove viewEngine)
CheckEntityViewsEngine(viewEngine, _reactiveEnginesAddRemove);
CheckEntityViewsEngine<IReactOnAddAndRemove>(viewEngine, _reactiveEnginesAddRemove);
if (engine is IReactOnSwap viewEngineSwap)
CheckEntityViewsEngine(viewEngineSwap, _reactiveEnginesSwap);
CheckEntityViewsEngine<IReactOnSwap>(viewEngineSwap, _reactiveEnginesSwap);

_enginesSet.Add(engine);

@@ -73,13 +73,13 @@ namespace Svelto.ECS
}
}
void CheckEntityViewsEngine(IEngine engine, Dictionary<Type, FasterList<IEngine>> engines)
void CheckEntityViewsEngine<T>(IEngine engine, Dictionary<Type, FasterList<IEngine>> engines)
{
var interfaces = engine.GetType().GetInterfaces();

foreach (var interf in interfaces)
{
if (interf.IsGenericTypeEx() && typeof(IReactEngine).IsAssignableFrom(interf))
if (interf.IsGenericTypeEx() && typeof(T).IsAssignableFrom(interf))
{
var genericArguments = interf.GetGenericArgumentsEx();



+ 1
- 1
Svelto.ECS/EnginesRoot.GenericEntityFunctions.cs View File

@@ -126,7 +126,7 @@ namespace Svelto.ECS
if (_entitiesOperations.TryGetValue((ulong) entitySubmitOperation.fromID, out var entitySubmitedOperation) == true)
{
if (entitySubmitedOperation != entitySubmitOperation)
Console.LogError("Only one entity operation per submission is allowed".FastConcat(" entityViewType: ")
throw new ECSException("Only one entity operation per submission is allowed".FastConcat(" entityViewType: ")
.FastConcat(typeof(T).Name)
.FastConcat(" submission type ", entitySubmitOperation.type.ToString(),
" from ID: ", entitySubmitOperation.fromID.entityID.ToString())


+ 1
- 1
Svelto.ECS/EnginesRoot.Submission.cs View File

@@ -56,7 +56,7 @@ namespace Svelto.ECS
}
catch (Exception e)
{
var str = "Crash while executing Entity Operation"
var str = "Crash while executing Entity Operation "
.FastConcat(entitiesOperations[i].type.ToString());
#if RELAXED_ECS && !PROFILER
Console.LogException(str.FastConcat(" "


Loading…
Cancel
Save