Closed itayalper closed 2 years ago
Entitas IContext has void AddEntityIndex(IEntityIndex entityIndex);
The generated code is just convenience and syntactic sugar
public static HashSet<TestEntity> GetEntitiesWithPosition(this GameContext context, IntVector2 position)
{
return ((EntityIndex)(context.GetEntityIndex(Contexts.EntityIndex))).GetEntitiesWithPosition(position);
}
and can be changed to your needs.
In future versions of Entitas we will completely avoid partial class in favour of extension methods.
See https://github.com/sschmid/Entitas/issues/992#issuecomment-1227761712
Hi,
I have have question about entity index (es) as the title points out, I want to know if there is any issue with creating a custom code generator that creates EntityIndex methods as interface(d) methods.
To further explain my specific use case, I have 2 major contexts: frontend and backend, whom share a lot of the same systems - it could save me a lot of time if the EntityIndex methods were to be generated like that.
Cheers