public static string Generate(UnityComponentDetails componentDetails, string qualifiedNamespace)
        {
            return(CodeWriter.Populate(cgw =>
            {
                cgw.UsingDirectives(
                    "System",
                    "System.Collections.Generic",
                    "System.Linq",
                    "Improbable.Gdk.Core"
                    );

                cgw.Namespace(qualifiedNamespace, ns =>
                {
                    ns.Type($"public partial class {componentDetails.ComponentName}", partial =>
                    {
                        partial.Type("internal static class ReferenceTypeProviders", providers =>
                        {
                            foreach (var fieldDetails in componentDetails.FieldDetails.Where(fd => !fd.IsBlittable))
                            {
                                providers.Type(UnityReferenceTypeProviderContent.Generate(fieldDetails, qualifiedNamespace, componentDetails.ComponentName));
                            }
                        });
                    });
                });
            }).Format());
        }
        public virtual string TransformText()
        {
            this.GenerationEnvironment = null;

            #line 3 "Templates\UnityReferenceTypeProviderGenerator.tt"

            var fieldDetailsList   = GetFieldDetailsList();
            var eventDetailsList   = GetEventDetailsList();
            var componentDetails   = GetComponentDetails();
            var commandDetailsList = GetCommandDetailsList();
            var generatedHeader    = CommonGeneratorUtils.GetGeneratedHeader();
            var generator          = new UnityReferenceTypeProviderContent();
            var componentNamespace = qualifiedNamespace + "." + componentDetails.ComponentName;


            #line default
            #line hidden

            #line 12 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(generatedHeader));

            #line default
            #line hidden

            #line 12 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write("\r\n\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing I" +
                       "mprobable.Gdk.Core;\r\n\r\nnamespace ");

            #line default
            #line hidden

            #line 19 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(qualifiedNamespace));

            #line default
            #line hidden

            #line 19 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write("\r\n{\r\n    public partial class ");

            #line default
            #line hidden

            #line 21 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(componentDetails.ComponentName));

            #line default
            #line hidden

            #line 21 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write("\r\n    {\r\n        internal static class ReferenceTypeProviders\r\n        {\r\n       " +
                       "     ");

            #line default
            #line hidden

            #line 25 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(CommonGeneratorUtils.IndentEveryNewline(generator.Generate("Updates", $"List<{componentNamespace}.Update>"), 3)));

            #line default
            #line hidden

            #line 25 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write("\r\n\r\n");

            #line default
            #line hidden

            #line 27 "Templates\UnityReferenceTypeProviderGenerator.tt"
            foreach (var fieldDetails in fieldDetailsList)
            {
            #line default
            #line hidden

            #line 28 "Templates\UnityReferenceTypeProviderGenerator.tt"
                if (!fieldDetails.IsBlittable)
                {
            #line default
            #line hidden

            #line 29 "Templates\UnityReferenceTypeProviderGenerator.tt"
                    this.Write("            ");

            #line default
            #line hidden

            #line 29 "Templates\UnityReferenceTypeProviderGenerator.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(CommonGeneratorUtils.IndentEveryNewline(generator.Generate(fieldDetails.PascalCaseName, fieldDetails.Type), 3)));

            #line default
            #line hidden

            #line 29 "Templates\UnityReferenceTypeProviderGenerator.tt"
                    this.Write("\r\n\r\n");

            #line default
            #line hidden

            #line 31 "Templates\UnityReferenceTypeProviderGenerator.tt"
                }

            #line default
            #line hidden

            #line 32 "Templates\UnityReferenceTypeProviderGenerator.tt"
            }

            #line default
            #line hidden

            #line 33 "Templates\UnityReferenceTypeProviderGenerator.tt"
            foreach (var eventDetails in eventDetailsList)
            {
            #line default
            #line hidden

            #line 34 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write("            ");

            #line default
            #line hidden

            #line 34 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CommonGeneratorUtils.IndentEveryNewline(generator.Generate(eventDetails.EventName, $"List<{eventDetails.FqnPayloadType}>"), 3)));

            #line default
            #line hidden

            #line 34 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write("\r\n");

            #line default
            #line hidden

            #line 35 "Templates\UnityReferenceTypeProviderGenerator.tt"
            }

            #line default
            #line hidden

            #line 36 "Templates\UnityReferenceTypeProviderGenerator.tt"
            foreach (var commandDetails in commandDetailsList)
            {
            #line default
            #line hidden

            #line 37 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write("            ");

            #line default
            #line hidden

            #line 37 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Sender", $"List<{qualifiedNamespace}.{componentDetails.ComponentName}.{commandDetails.CommandName}.Request>"), 3)));

            #line default
            #line hidden

            #line 37 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write("\r\n            ");

            #line default
            #line hidden

            #line 38 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Requests", $"List<{qualifiedNamespace}.{componentDetails.ComponentName}.{commandDetails.CommandName}.ReceivedRequest>"), 3)));

            #line default
            #line hidden

            #line 38 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write("\r\n            ");

            #line default
            #line hidden

            #line 39 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Responder", $"List<{qualifiedNamespace}.{componentDetails.ComponentName}.{commandDetails.CommandName}.Response>"), 3)));

            #line default
            #line hidden

            #line 39 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write("\r\n            ");

            #line default
            #line hidden

            #line 40 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(CommonGeneratorUtils.IndentEveryNewline(generator.Generate($"{commandDetails.CommandName}Responses", $"List<{qualifiedNamespace}.{componentDetails.ComponentName}.{commandDetails.CommandName}.ReceivedResponse>"), 3)));

            #line default
            #line hidden

            #line 40 "Templates\UnityReferenceTypeProviderGenerator.tt"
                this.Write("\r\n\r\n");

            #line default
            #line hidden

            #line 42 "Templates\UnityReferenceTypeProviderGenerator.tt"
            }

            #line default
            #line hidden

            #line 43 "Templates\UnityReferenceTypeProviderGenerator.tt"
            this.Write("        }\r\n    }\r\n}\r\n");

            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }