Ejemplo n.º 1
0
        public override void Decompile()
        {
            if (Rule.EventInfo.Event != RuleEvent.Subroutine)
            {
                if (Rule.Disabled)
                {
                    Decompiler.Append("disabled ");
                }
                Decompiler.Append("rule: \"" + Rule.Name + "\"");

                if (Rule.EventInfo.Event != RuleEvent.OngoingGlobal)
                {
                    Decompiler.NewLine();
                    Decompiler.Append("Event." + EnumData.GetEnumValue(Rule.EventInfo.Event).CodeName);
                    // Write the event.
                    if (Rule.EventInfo.Team != Team.All)
                    {
                        Decompiler.NewLine();
                        Decompiler.Append("Team." + EnumData.GetEnumValue(Rule.EventInfo.Team).CodeName);
                    }
                    // Write the player.
                    if (Rule.EventInfo.Player != PlayerSelector.All)
                    {
                        Decompiler.NewLine();
                        Decompiler.Append("Player." + EnumData.GetEnumValue(Rule.EventInfo.Player).CodeName);
                    }
                }

                // Decompile conditions
                foreach (var condition in Rule.Conditions)
                {
                    condition.Decompile(this);
                }
            }
            else
            {
                Decompiler.Append("void " + Rule.EventInfo.SubroutineName + "() \"" + Rule.Name + "\"");
            }

            Decompiler.AddBlock();

            DecompileActions();

            Decompiler.Outdent();
            Decompiler.Append("}");
            Decompiler.NewLine();
            Decompiler.NewLine();
        }
Ejemplo n.º 2
0
 public void Append(string text) => Decompiler.Append(text);