示例#1
0
        void ProcessCommand(string command)
        {
            int index = command.IndexOf("=");

            if (index > 0)
            {
                string tag = command.Substring(0, index);
                command = command.Substring(index + 1);

                if (tag.Equals("sm"))
                {
                    string[] detail = command.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                    if (detail.Length > 0)
                    {
                        RobotMessage robotMessage = new RobotMessage(detail);

                        Action <string> processor;
                        if (messageProcessors.TryGetValue(robotMessage.GetMessageType, out processor))
                        {
                            //Debug.Log(robotMessage);
                            processor(robotMessage.GetMessage);
                        }
                    }
                }
            }
        }
示例#2
0
 public ParsedMessage(string script, string totalCommand)
 {
     this.script = script;
     command     = new RobotMessage(totalCommand);
 }