public void Execute(string input) { if (input == null) { throw new ArgumentException(nameof(input)); } _commandBroker.ResetParsers(RegistrationService.Container.ResolveKeyed <ICommandParser>(nameof(PlaceParser))); var result = _commandBroker.GetCommand(input); if (result.found) { _robot.Execute(result.command); } }
private void HandleMessage(ICommand cmd, IRobot robot) { DebugUtility.Log(LoggerTags.Online, "{0} Handling message : {1}", robot, cmd); ICommandResponseAsync waiting = robot.Execute(cmd); if (waiting == null) { DebugUtility.LogError(LoggerTags.Online, "Can't handle message : {0}", cmd); return; } if (mConnInfos.TryGetValue(robot, out var conn)) { DebugUtility.Log(LoggerTags.Online, "Waiting : {0}", waiting); conn.waitings.Add(waiting); } else if (mAcitivedConn != null) { mAcitivedConn.waitings.Add(waiting); } }