Browse Source

add comment and rename function

tags/Rel25b
sebas77 6 years ago
parent
commit
081dde24b0
2 changed files with 8 additions and 2 deletions
  1. +2
    -2
      Svelto.ECS/DataStructures/TypeSafeDictionary.cs
  2. +6
    -0
      Svelto.ECS/EnginesRoot.Submission.cs

+ 2
- 2
Svelto.ECS/DataStructures/TypeSafeDictionary.cs View File

@@ -70,11 +70,11 @@ namespace Svelto.ECS.Internal
{
TValue entity = values[i];

AddEntityViewFromEngines(entityViewEnginesDB, ref entity);
AddEntityViewToEngines(entityViewEnginesDB, ref entity);
}
}

void AddEntityViewFromEngines(Dictionary<Type, FasterList<IHandleEntityViewEngineAbstracted>> entityViewEnginesDB, ref TValue entity)
void AddEntityViewToEngines(Dictionary<Type, FasterList<IHandleEntityViewEngineAbstracted>> entityViewEnginesDB, ref TValue entity)
{
FasterList<IHandleEntityViewEngineAbstracted> entityViewsEngines;
//get all the engines linked to TValue


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

@@ -23,6 +23,12 @@ namespace Svelto.ECS
//current will be use to write new entityViews
_groupedEntityToAdd.Swap();

//Note: if N entity of the same type are added on the same frame
//the Add callback is called N times on the same frame.
//if the Add calback builds a new entity, that entity will not
//be available in the database until the N callbacks are done
//solving it could be complicated as callback and database update
//must be interleaved.
if (_groupedEntityToAdd.other.Count > 0)
AddEntityViewsToTheDBAndSuitableEngines(_groupedEntityToAdd.other);



Loading…
Cancel
Save