CommandGlobal.cs 764 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using StageController.M3H;
  2. using System;
  3. namespace StageController
  4. {
  5. /// <summary>
  6. /// 4.4 电脑控制全局指令
  7. /// </summary>
  8. public class CommandGlobal : CommandBase
  9. {
  10. private ControlType m_type;
  11. public CommandGlobal(ControlType type)
  12. {
  13. m_type = type;
  14. }
  15. public override string Make()
  16. {
  17. return "@C" + Enum.GetName(typeof(ControlType), m_type) + "!";
  18. }
  19. public override bool Parse(string response)
  20. {
  21. bool retVal = false;
  22. string tmpRes = "@C" + m_type + "!";
  23. if (tmpRes.CompareTo(response) == 0)
  24. {
  25. retVal = true;
  26. }
  27. return retVal;
  28. }
  29. }
  30. }