LBL.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. namespace OpenVIII.Fields.Scripts.Instructions
  2. {
  3. /// <summary>
  4. /// <para>Label</para>
  5. /// <para>Specify the absolute identifier of the script. Each script starts with this opcode. This may be redundant and optional information.</para>
  6. /// </summary>
  7. /// <see cref="http://wiki.ffrtt.ru/index.php?title=FF8/Field/Script/Opcodes/005_LBL"/>
  8. public sealed class LBL : JsmInstruction
  9. {
  10. #region Constructors
  11. public LBL(int label) => Label = label;
  12. public LBL(int label, IStack<IJsmExpression> stack)
  13. : this(label)
  14. {
  15. }
  16. #endregion Constructors
  17. #region Properties
  18. /// <summary>
  19. /// Script ID.
  20. /// </summary>
  21. public int Label { get; }
  22. #endregion Properties
  23. #region Methods
  24. public override IAwaitable Execute(IServices services) => DummyAwaitable.Instance;
  25. public override void Format(ScriptWriter sw, IScriptFormatterContext formatterContext, IServices services) => sw.AppendLine($"// ScriptId: {Label}");
  26. public override string ToString() => $"{nameof(LBL)}({nameof(Label)}: {Label})";
  27. #endregion Methods
  28. }
  29. }