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

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

        source.EndBlock();
    }
예제 #2
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();
    }
        public override void Render(CompilationUnitSource source)
        {
            if (RequiredImport != null)
            {
                source.Using(RequiredImport);
            }

            string vStr = "";

            if (Visibility.HasValue)
            {
                vStr = Visibility.GetValueOrDefault().ToString().ToLower();
            }

            source.AddLine($"{vStr} {Type} {Name} {{ get; set; }}");
        }
예제 #4
0
    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();
        }
    }