REQ.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. namespace OpenVIII.Fields.Scripts.Instructions.Abstract
  2. {
  3. public abstract class REQ : JsmInstruction
  4. {
  5. #region Fields
  6. /// <summary>
  7. /// The ID of the target Entity.
  8. /// </summary>
  9. protected readonly int _objectIndex;
  10. /// <summary>
  11. /// Priority
  12. /// </summary>
  13. protected readonly int _priority;
  14. /// <summary>
  15. /// Label
  16. /// </summary>
  17. protected readonly int _scriptId;
  18. #endregion Fields
  19. #region Constructors
  20. public REQ(int objectIndex, int priority, int scriptId)
  21. {
  22. _objectIndex = objectIndex;
  23. _priority = priority;
  24. _scriptId = scriptId;
  25. }
  26. public REQ(int objectIndex, IStack<IJsmExpression> stack)
  27. : this(objectIndex,
  28. scriptId: ((IConstExpression)stack.Pop()).Int32(),
  29. priority: ((IConstExpression)stack.Pop()).Int32())
  30. {
  31. }
  32. #endregion Constructors
  33. #region Methods
  34. public abstract override void Format(ScriptWriter sw, IScriptFormatterContext formatterContext, IServices services);
  35. public abstract override IAwaitable TestExecute(IServices services);
  36. public abstract override string ToString();
  37. #endregion Methods
  38. }
  39. }