public override void Render(CompilationUnitSource source)
    {
        source.AddLine($"public enum {Name}");
        source.StartBlock();

        foreach (string literal in Literals)
        {
            source.AddLine($"{literal},");
        }

        source.EndBlock();
    }
    public override void Render(CompilationUnitSource source)
    {
        if (ClassNamespace != null)
        {
            source.AddLine($"namespace {ClassNamespace}");
            source.StartBlock();
        }

        foreach (CompilationUnitFragment fragment in Fragments)
        {
            fragment.Render(source);
        }

        if (ClassNamespace != null)
        {
            source.EndBlock();
        }
    }
Example #3
0
    public override void Render(CompilationUnitSource source)
    {
        string extends = "";

        if (BaseClass != null)
        {
            extends = $" : {BaseClass}";
        }

        source.AddLine($"using LDtk;");
        source.AddLine($"using Microsoft.Xna.Framework;");
        source.AddLine("");
        source.AddLine($"public class {Name}{extends}");
        source.StartBlock();

        foreach (CompilationUnitField field in Fields)
        {
            field.Render(source);
        }

        source.EndBlock();
    }