public static void GenGameContext(FileGenerator file, ComponentList components)
        {
            file.AddLine("public partial class GameEntity : ECSCore.Entity");
            file.BeginScop();
            file.EndScop();
            file.AddLine();

            file.AddLine("public partial class GameContext : ECSCore.Context<GameEntity>");
            using (new FileGenerator.Scop(file))
            {
                GenEntityIndexKey(file, components.GameComponents);
                file.AddLine("public GameContext(int totalComponents, string[] names, System.Type[] types, string name)");
                file.AddLine("    : base(totalComponents, 0, new ECSCore.ContextInfo(name, names, types),");
                file.AddLine("          (entity) =>\n#if (!UNITY_EDITOR)");
                file.AddLine("            new UnsafeAERC(),\n#else");
                file.AddLine("            new ECSCore.SafeAERC(entity),\n#endif");
                file.AddLine("             () => new GameEntity())");
                using (new FileGenerator.Scop(file))
                {
                    file.AddLine("InitializeEntityIndices();");
                }
                file.AddLine();

                file.AddLine("public GameContext(int totalComponents, string[] names, System.Type[] types)");
                file.AddLine("   : this(totalComponents, names, types, \"Game\")");
                file.BeginScop();
                file.EndScop();
                file.AddLine();

                file.AddLine("public GameContext()");
                file.AddLine("   : this(GameComponentsLookup.TotalComponents, GameComponentsLookup.componentNames, GameComponentsLookup.componentTypes, \"Game\")");
                file.BeginScop();
                file.EndScop();
                file.AddLine();

                file.AddLine("protected virtual void InitializeEntityIndices()");
                using (new FileGenerator.Scop(file))
                {
                    GenEntityIndex(file, components.GameComponents, false);
                }
                file.AddLine();
                GenGetEntityIndex(file, components.GameComponents, false);
            }
            GenMatcher(file);
        }
 public static void GenViewContext(FileGenerator file, ComponentList components)
 {
     file.AddLine("public partial class ViewContext : GameContext");
     using (new FileGenerator.Scop(file))
     {
         GenEntityIndexKey(file, components.ViewComponents);
         file.AddLine("public ViewContext()");
         file.AddLine("   : base(ViewComponentsLookup.TotalComponents, ViewComponentsLookup.componentNames, ViewComponentsLookup.componentTypes, \"View\")");
         file.BeginScop();
         file.EndScop();
         file.AddLine();
         file.AddLine("protected override void InitializeEntityIndices()");
         using (new FileGenerator.Scop(file))
         {
             file.AddLine("base.InitializeEntityIndices();");
             GenEntityIndex(file, components.ViewComponents, true);
         }
         file.AddLine();
         GenGetEntityIndex(file, components.ViewComponents, true);
     }
 }
 public Scop(FileGenerator generator, bool semicolons = false)
 {
     fileGenerator  = generator;
     WithSemicolons = semicolons;
     fileGenerator.BeginScop();
 }