From ecc90ab8a274dc6b7d74977f150d6d145c16a7ad Mon Sep 17 00:00:00 2001 From: sebas77 Date: Tue, 3 Jul 2018 18:22:33 +0100 Subject: [PATCH] Add more functions for convenience --- .gitmodules | 3 --- Svelto.ECS/EntitiesDB.cs | 20 ++++++++++++++++++++ Svelto.ECS/IEntitiesDB.cs | 6 ++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 532d6f0..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "Svelto.Common"] - path = Svelto.Common - url = https://github.com/sebas77/Svelto.Common.git diff --git a/Svelto.ECS/EntitiesDB.cs b/Svelto.ECS/EntitiesDB.cs index db67eff..7619fd4 100644 --- a/Svelto.ECS/EntitiesDB.cs +++ b/Svelto.ECS/EntitiesDB.cs @@ -102,6 +102,26 @@ namespace Svelto.ECS.Internal casted.ExecuteOnEntityView(entityGID.entityID, action); } + public void ExecuteOnEntity(int id, ActionRef action) where T : IEntityStruct + { + ExecuteOnEntity(new EGID(id, ExclusiveGroup.StandardEntitiesGroup), action); + } + + public void ExecuteOnEntity(int id, int groupid, ActionRef action) where T : IEntityStruct + { + ExecuteOnEntity(new EGID(id, groupid), action); + } + + public void ExecuteOnEntity(int id, ref W value, ActionRef action) where T : IEntityStruct + { + ExecuteOnEntity(new EGID(id, ExclusiveGroup.StandardEntitiesGroup), ref value, action); + } + + public void ExecuteOnEntity(int id, int groupid, ref W value, ActionRef action) where T : IEntityStruct + { + ExecuteOnEntity(new EGID(id, groupid), ref value, action); + } + public void ExecuteOnEntities(int groupID, ActionRef action) where T : IEntityStruct { int count; diff --git a/Svelto.ECS/IEntitiesDB.cs b/Svelto.ECS/IEntitiesDB.cs index 359f33a..8efd084 100644 --- a/Svelto.ECS/IEntitiesDB.cs +++ b/Svelto.ECS/IEntitiesDB.cs @@ -39,6 +39,12 @@ namespace Svelto.ECS void ExecuteOnEntity(EGID egid, ref W value, ActionRef action) where T : IEntityStruct; void ExecuteOnEntity(EGID egid, ActionRef action) where T : IEntityStruct; + void ExecuteOnEntity(int id, ActionRef action) where T : IEntityStruct; + void ExecuteOnEntity(int id, int groupid, ActionRef action) where T : IEntityStruct; + + void ExecuteOnEntity(int id, ref W value, ActionRef action) where T : IEntityStruct; + void ExecuteOnEntity(int id, int groupid, ref W value, ActionRef action) where T : IEntityStruct; + void ExecuteOnEntities(int groupID, ActionRef action) where T : IEntityStruct; void ExecuteOnEntities(ActionRef action) where T : IEntityStruct;