// Appends the set of slides if it has not been seen yet void TutorialManager::setSlides(TutorialSlidesType type) { if (isEnabled() && !visitedSlide[type]) { setSlides(getSlides(type)); visitedSlide[type] = true; } }
// Load set of slides in a queue with a timer that when expired, will load the slides up void TutorialManager::prepareSlides(TutorialSlidesType type, float startTimer) { if (type == TUTORIAL_END_OF_SESSION) special = true; if ((isEnabled() && !visitedSlide[type]) || (type == TUTORIAL_END_OF_SESSION)) { prepareSlides(getSlides(type), startTimer); visitedSlide[type] = true; } }
std::vector<std::pair<Board, Board::NewStateData>> Board::getNextStatesWithStateData(int currentMove) { std::vector<std::pair<Board, NewStateData>> nextStates; //std::cout << currentMove << std::endl; static std::set<int> placeTurns = { 1, 2, 3, 6, 7, 8 }; bool isPlaceTurn = placeTurns.find((currentMove + 1) % 10) != placeTurns.end(); if (isPlaceTurn) { Tile::TileColor color = Player::getTileColorForMove((currentMove + 1) % 10); std::vector<std::pair<int, int>> places = getPlaces(color, 0); for (int i = 0; i < places.size(); i++) { std::pair<int, int> x = places[i]; Board b = Board(this); b.placeTile(color, x.first, x.second, 1); Board::NewStateData nsd = Board::NewStateData(x.first, x.second, color); std::pair<Board, NewStateData> pair = std::make_pair(b, nsd); nextStates.push_back(pair); } } else { std::vector<MOVE> slides = getSlides(); for (int i = 0; i < slides.size(); i++) { MOVE x = slides[i]; Board b = Board(this); b.slideBoard(x); if (b.gameScore() != 0) { NewStateData nsd = NewStateData(x); std::pair<Board, NewStateData> pair = std::make_pair(b, nsd); nextStates.push_back(pair); } } } return nextStates; };