StoryTeller.Model.Paragraph.ToMissingCode C# (CSharp) Method

ToMissingCode() public method

public ToMissingCode ( bool withinParagraph = false ) : string
withinParagraph bool
return string
        public override string ToMissingCode(bool withinParagraph = false)
        {
            // just assume that it's all inline
            for (var i = 0; i < children.Length; i++)
                children[i].key = $"{key}_{i + 1}";

            var childrenCode = children.Select(child => child.ToMissingCode(true))
                .Join(Environment.NewLine + Environment.NewLine);

            var childrenAdds = children.Select(child => $"            _ += this[\"{child.key}\"];")
                .Join(Environment.NewLine);

            return $@"
{childrenCode}

        public {typeof(IGrammar).FullName} {key}()
        {{
            return Paragraph(""{title}"", _ => {{
{childrenAdds}
            }});

        }}
";
        }