12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace StageController
- {
- public enum LightType
- {
- POLARIZED = 0, // 偏光
- BRIGHT = 1, // 明场
- }
- public class CommandMotorizedLight : CommandBase
- {
- private string m_type;
- public CommandMotorizedLight(LightType type)
- {
- switch (type)
- {
- case LightType.POLARIZED:
- m_type = "-";
- break;
- case LightType.BRIGHT:
- m_type = "+";
- break;
- }
- }
- public override string Make()
- {
- return "@" + m_type + "!";
- }
- public override bool Parse(string response)
- {
- string tmpRes = "@" + m_type + "!";
- if (tmpRes.CompareTo(response) == 0)
- {
- return true;
- }
- return false;
- }
- }
- }
|