Jsm.Control.If.ElseSegment.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace FF8
  5. {
  6. public static partial class Jsm
  7. {
  8. public static partial class Control
  9. {
  10. public sealed partial class If
  11. {
  12. private sealed class ElseSegment : Segment
  13. {
  14. public ElseSegment(Int32 from, Int32 to)
  15. : base(from, to)
  16. {
  17. }
  18. public override void ToString(StringBuilder sb)
  19. {
  20. sb.AppendLine("else");
  21. FormatBranch(sb, GetBodyInstructions());
  22. }
  23. public override void Format(ScriptWriter sw, IScriptFormatterContext formatterContext, IServices services)
  24. {
  25. sw.AppendLine("else");
  26. FormatBranch(sw, formatterContext, services, GetBodyInstructions());
  27. }
  28. public IEnumerable<IJsmInstruction> GetBodyInstructions()
  29. {
  30. return _list;
  31. }
  32. }
  33. }
  34. }
  35. }
  36. }