CommandMotorizedLight.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace StageController
  7. {
  8. public enum LightType
  9. {
  10. POLARIZED = 0, // 偏光
  11. BRIGHT = 1, // 明场
  12. }
  13. public class CommandMotorizedLight : CommandBase
  14. {
  15. private string m_type;
  16. public CommandMotorizedLight(LightType type)
  17. {
  18. switch (type)
  19. {
  20. case LightType.POLARIZED:
  21. m_type = "-";
  22. break;
  23. case LightType.BRIGHT:
  24. m_type = "+";
  25. break;
  26. }
  27. }
  28. public override string Make()
  29. {
  30. return "@" + m_type + "!";
  31. }
  32. public override bool Parse(string response)
  33. {
  34. string tmpRes = "@" + m_type + "!";
  35. if (tmpRes.CompareTo(response) == 0)
  36. {
  37. return true;
  38. }
  39. return false;
  40. }
  41. }
  42. }