void QryPlnrDsnDsn1NDomaingd::handleRequest( DbsPlnr* dbsplnr , ReqPlnr* req ) { if (req->ixVBasetype == ReqPlnr::VecVBasetype::CMD) { reqCmd = req; if (req->cmd.compare("cmdset") == 0) { cout << "\trefresh" << endl; cout << "\tshow" << endl; } else if (req->cmd.compare("refresh") == 0) { req->retain = handleRefresh(dbsplnr); } else if (req->cmd.compare("show") == 0) { req->retain = handleShow(dbsplnr); } else { cout << "\tinvalid command!" << endl; }; if (!req->retain) reqCmd = NULL; } else if (req->ixVBasetype == ReqPlnr::VecVBasetype::REGULAR) { }; };
void Keyboard::handlePPSMessage(PPSObject const& message) { #ifdef PPS_KEYBOARD_DEBUG qDebug() << "Handling pps message with attributes: " << message.attributes(); #endif if (message.objectStatus() != PPSObject::Undefined && message.objectStatus() != PPSObject::Created) { // In all other cases the keyboard service is probably gone. handleHide(); return; } QVariantHash attributes = message.attributes().toHash(); QString msg = attributes[QString::fromLatin1("msg")].toString(); // We don't care if it's a response or message right now. if(msg.isEmpty()) msg = attributes[QString::fromLatin1("res")].toString(); if (msg.compare(QString::fromLatin1("show"), Qt::CaseInsensitive) == 0) handleShow(); else if (msg.compare(QString::fromLatin1("hide"), Qt::CaseInsensitive) == 0) handleHide(); else if (msg.compare(QString::fromLatin1("info"), Qt::CaseInsensitive) == 0) handleInfo(attributes[QString::fromLatin1("dat")]); else if (msg.compare(QString::fromLatin1("connect"), Qt::CaseInsensitive) == 0) return; // We don't care, but no need to log a warning. else qWarning() << "Unsupported message type from keyboard: " << msg; }
void QryFmncFab1NFabuser::handleRequest( DbsFmnc* dbsfmnc , ReqFmnc* req ) { if (req->ixVBasetype == ReqFmnc::VecVBasetype::CMD) { reqCmd = req; if (req->cmd.compare("cmdset") == 0) { cout << "\trefresh" << endl; cout << "\tshow" << endl; } else if (req->cmd == "refresh") { req->retain = handleRefresh(dbsfmnc); } else if (req->cmd == "show") { req->retain = handleShow(dbsfmnc); } else { cout << "\tinvalid command!" << endl; }; if (!req->retain) reqCmd = NULL; } else if (req->ixVBasetype == ReqFmnc::VecVBasetype::REGULAR) { }; };
void Menu::show(bool playAnim) { if (showAnim_.size() && playAnim) { FliPlayer fliPlayer; uint8 *data; int size; data = File::loadFile(showAnim_.c_str(), size); fliPlayer.loadFliData(data, false); fliPlayer.play(); delete[] data; } if (background_) { g_Screen.scale2x(clear_x_, clear_y_, clear_w_ / 2, clear_h_ / 2, background_ + (clear_x_ / 2) + (clear_y_ / 2) * 320, 320); } for (std::list < MenuText >::iterator it = statics_.begin(); it != statics_.end(); it++) { MenuText & m = *it; g_App.fonts().drawText(m.x_, m.y_, m.text_.c_str(), m.size_, m.dark_); } handleShow(); redrawOptions(); }
int ConsoleGame::run() { // std::string cmdString("4"); // std::istringstream iss(cmdString); // handlePerft(iss); // return 0; while (true) { std::cout << "\nsc: "; std::string inputString; std::getline(std::cin, inputString); std::istringstream iss(inputString); std::string commandString; iss >> commandString; if (commandString.empty()) continue; if (commandString == "quit") break; else if (commandString == "divide") handleDivide(iss); else if (commandString == "help") handleHelp(); else if (commandString == "print") handlePrint(); else if (commandString == "disp") handlePrint(); else if (commandString == "fen") handleFen(); else if (commandString == "perft") handlePerft(iss); // else if (commandString == "table") // handleTable(iss); else if (commandString == "move") handleMove(iss); else if (commandString == "setboard") handleSetBoard(iss); else if (commandString == "testmovegen") handleTestMoveGen(); else if (commandString == "new") handleNewGame(); else if (commandString == "show") handleShow(); else if (commandString == "undo") handleUndo(); else if (commandString == "twoplayer") handleTwoPlayer(); else if (commandString == "singleplayer") handleSinglePlayer(); else { std::cout << "Unrecognized command " << commandString << "\n"; std::cout << "Type help to show command list\n"; } } return 0; }