void PageTemplate::parseTemplate() { int firstIndex=placeMarkerRegExp.indexIn(templateString); if(firstIndex) { QStringList markerList = placeMarkerRegExp.capturedTexts(); int numberOfMarkers=placeMarkerRegExp.captureCount(); //qDebug()<<markerList.count()<<numberOfMarkers; for(int i=0;i<numberOfMarkers;++i) { //qDebug()<<placeMarkerRegExp.pos(i)<<markerList.at(i); QString field=markerList.at(i).mid(3,markerList.at(i).length()-6); if(placeMarkers.contains(field)) { placeMarkers[field].addPosition(placeMarkerRegExp.pos(i)); } else { placeMarkers[field]=PlaceMarker(field,placeMarkerRegExp.pos(i)); } } } }
// Return true if move was played bool CBoard::PlayMove(int x, int y, int player) { if (!IsTileFree(x, y)) { return false; } PlaceMarker(x, y, player); m_iNumberOfIcons += 1; return true; }
void Game::update(){ for (auto gameObject : m_gameObjects){ gameObject->update(); } for (auto gameObject : m_foregroundObjects){ gameObject->update(); } for (auto gameObject : m_backgroundObjects){ gameObject->update(); } cursor->GetParams().setY(InputHandler::Instance()->getMousePos().y - 31); cursor->GetParams().setX(InputHandler::Instance()->getMousePos().x - 20); ClearOffscreenObjects(); m_mileCoolDownTimer--; if ((m_markerTimer >= m_markerTimerTick) && m_mileCoolDownTimer <=0){ PlaceMarker(); m_markerTimer = 0; } if (m_bubblesPassed >= m_bubblesPerMile){ s_level++; if (s_level < 100){ m_bubblesPerMile += s_level/4; } m_bubblesPassed = 0; m_milesPassed++; if (m_milesPassed > m_hiScore){ m_hiScore = m_milesPassed; } PlaceMileMarker(); m_mileCoolDownTimer = m_mileCoolDownTime; } m_trailSpeed = -s_level * m_trailSpeedMod; //cout << "Total objects on screen " << m_gameObjects.size() << endl; }