/** \brief The given input will be analysed. If the input is usable (matching to an RegEx), a fitting operation will be executed. * * \param input std::string The users inout. * \return bool True if an action has been executed. * */ bool MainMenu::executeInput(std::string input) { bool executedInput = false; std::regex start_expr("((s|S)(tart))|(START)"); std::regex wtf_expr("(wtf|WTF)"); if(_introView == NULL) { if(std::regex_match(input, start_expr)) { _introView = new StoryView("intro", "text1", _gameManager); executedInput = true; } else if(std::regex_match(input, wtf_expr)) { _gameManager->clearScreen(); StoryView wtfStory("wtf", "wtf", _gameManager); wtfStory.update(""); _gameManager->printText("glowing-octo-batman is an ASCII based adventure game written in C++.\nYou have to do stuff in this game.\n"); executedInput = true; } } else if(_introView->getCurrentSentence() == "$exit" && input == "") { MapViewer *mapView = new MapViewer(_drawer, _gameManager); _gameManager->changeGameScreen(mapView); delete this; } return executedInput; }
void EvalLValExpr( unsigned addr_depth ) { SetUpExpr( addr_depth ); start_expr(); }
void ChkExpr( void ) { SkipCount = 1; ExprAddrDepth = 1; start_expr(); }