예제 #1
0
/** This method is called with when input is sent to the mud */
QString CMapFilter::processCommand (const QString &command)
{
  if (mapManager->validMoveCmd(command))
  {
    bool found = false;

    for (CMapViewBase *view = mapManager->getViewList()->first(); view !=0 ; view = mapManager->getViewList()->next())
      if (view->getFollowMode())
      {
        found = true;
        break;
      }

    if (found)
    {
      QString newStr;
      newStr += executeBeforeCommand (command);
      newStr += command;
      newStr += executeAfterCommand (command);

      if (mapManager->getMapData()->validRoomCheck)
        directionCmdQueue.enqueue(new QString (command));
      else
        mapManager->movePlayerBy(command);
      return newStr;
    }
  }
  return command;
}
예제 #2
0
/** This method is called with when input is sent to the mud */
QString CMapFilter::processCommand (const QString &command)
{
  if (mapManager->validMoveCmd(command))
  {
    CMapView *view = mapManager->getActiveView();
    if (view->getFollowMode())
    {
      QString newStr;
      newStr += executeBeforeCommand (command);
      newStr += command;
      newStr += executeAfterCommand (command);

      if (mapManager->getMapData()->validRoomCheck)
        directionCmdQueue.enqueue(new QString (command));
      else
        mapManager->movePlayerBy(command);
      return newStr;
    }
  }
  return command;
}