HIDE.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. namespace OpenVIII.Fields.Scripts.Instructions
  2. {
  3. /// <summary>
  4. /// Hides this entity's model on the field. See also SHOW.
  5. /// </summary>
  6. internal sealed class HIDE : JsmInstruction
  7. {
  8. #region Constructors
  9. public HIDE()
  10. {
  11. }
  12. public HIDE(int parameter, IStack<IJsmExpression> stack)
  13. : this()
  14. {
  15. }
  16. #endregion Constructors
  17. #region Methods
  18. public override void Format(ScriptWriter sw, IScriptFormatterContext formatterContext, IServices services) => sw.Format(formatterContext, services)
  19. .Property(nameof(FieldObject.Model))
  20. .Method(nameof(FieldObjectModel.Hide))
  21. .Comment(nameof(HIDE));
  22. public override IAwaitable TestExecute(IServices services)
  23. {
  24. var currentObject = ServiceId.Field[services].Engine.CurrentObject;
  25. currentObject.Model.Hide();
  26. return DummyAwaitable.Instance;
  27. }
  28. public override string ToString() => $"{nameof(HIDE)}()";
  29. #endregion Methods
  30. }
  31. }