Browse Source

Add more functions for convenience

tags/Rel25b
sebas77 6 years ago
parent
commit
ecc90ab8a2
3 changed files with 26 additions and 3 deletions
  1. +0
    -3
      .gitmodules
  2. +20
    -0
      Svelto.ECS/EntitiesDB.cs
  3. +6
    -0
      Svelto.ECS/IEntitiesDB.cs

+ 0
- 3
.gitmodules View File

@@ -1,3 +0,0 @@
[submodule "Svelto.Common"]
path = Svelto.Common
url = https://github.com/sebas77/Svelto.Common.git

+ 20
- 0
Svelto.ECS/EntitiesDB.cs View File

@@ -102,6 +102,26 @@ namespace Svelto.ECS.Internal
casted.ExecuteOnEntityView(entityGID.entityID, action);
}

public void ExecuteOnEntity<T>(int id, ActionRef<T> action) where T : IEntityStruct
{
ExecuteOnEntity(new EGID(id, ExclusiveGroup.StandardEntitiesGroup), action);
}

public void ExecuteOnEntity<T>(int id, int groupid, ActionRef<T> action) where T : IEntityStruct
{
ExecuteOnEntity(new EGID(id, groupid), action);
}

public void ExecuteOnEntity<T, W>(int id, ref W value, ActionRef<T, W> action) where T : IEntityStruct
{
ExecuteOnEntity(new EGID(id, ExclusiveGroup.StandardEntitiesGroup), ref value, action);
}

public void ExecuteOnEntity<T, W>(int id, int groupid, ref W value, ActionRef<T, W> action) where T : IEntityStruct
{
ExecuteOnEntity(new EGID(id, groupid), ref value, action);
}

public void ExecuteOnEntities<T>(int groupID, ActionRef<T> action) where T : IEntityStruct
{
int count;


+ 6
- 0
Svelto.ECS/IEntitiesDB.cs View File

@@ -39,6 +39,12 @@ namespace Svelto.ECS
void ExecuteOnEntity<T, W>(EGID egid, ref W value, ActionRef<T, W> action) where T : IEntityStruct;
void ExecuteOnEntity<T>(EGID egid, ActionRef<T> action) where T : IEntityStruct;
void ExecuteOnEntity<T>(int id, ActionRef<T> action) where T : IEntityStruct;
void ExecuteOnEntity<T>(int id, int groupid, ActionRef<T> action) where T : IEntityStruct;
void ExecuteOnEntity<T, W>(int id, ref W value, ActionRef<T, W> action) where T : IEntityStruct;
void ExecuteOnEntity<T, W>(int id, int groupid, ref W value, ActionRef<T, W> action) where T : IEntityStruct;
void ExecuteOnEntities<T>(int groupID, ActionRef<T> action) where T : IEntityStruct;
void ExecuteOnEntities<T>(ActionRef<T> action) where T : IEntityStruct;


Loading…
Cancel
Save