diff --git a/src/Utils/ITemplateNode.cs b/src/Utils/ITemplateNode.cs new file mode 100644 index 0000000..3f4d985 --- /dev/null +++ b/src/Utils/ITemplateNode.cs @@ -0,0 +1,22 @@ +namespace DCFApixels.DragonECS +{ + public interface ITemplateNode + { + void Apply(int worldID, int entityID); + } + public static class ITemplateNodeExtensions + { + public static int NewEntity(this EcsWorld world, ITemplateNode template) + { + int e = world.NewEntity(); + template.Apply(world.id, e); + return e; + } + public static entlong NewEntityLong(this EcsWorld world, ITemplateNode template) + { + entlong e = world.NewEntityLong(); + template.Apply(world.id, e.ID); + return e; + } + } +} \ No newline at end of file