GLvoid CBlock::digBlock() { if(!CV_GAME_MANAGER->getLevelManager()->isFullBlock(this)) return; setType(CV_BLOCK_TYPE_UNCLAIMED_LAND_ID); setMarked(false); //init and finalize surrounding blocks aswell as this one CV_GAME_MANAGER->getLevelManager()->getBlock(logicalPosition[0],logicalPosition[1]-1)->init(); CV_GAME_MANAGER->getLevelManager()->getBlock(logicalPosition[0]-1,logicalPosition[1])->init(); CV_GAME_MANAGER->getLevelManager()->getBlock(logicalPosition[0]+1,logicalPosition[1])->init(); CV_GAME_MANAGER->getLevelManager()->getBlock(logicalPosition[0],logicalPosition[1]+1)->init(); init(); CV_GAME_MANAGER->getLevelManager()->getBlock(logicalPosition[0],logicalPosition[1]-1)->finalize(); CV_GAME_MANAGER->getLevelManager()->getBlock(logicalPosition[0]-1,logicalPosition[1])->finalize(); CV_GAME_MANAGER->getLevelManager()->getBlock(logicalPosition[0]+1,logicalPosition[1])->finalize(); CV_GAME_MANAGER->getLevelManager()->getBlock(logicalPosition[0],logicalPosition[1]+1)->finalize(); finalize(); if(CV_GAME_MANAGER->getControlManager()->getViewFrustum()->containsBBOX(getBoundingBox())) { //since the block is visible, create the digg effect (TODO) } }
CheckBox::CheckBox() { setMarked(false); setFocusable(true); addMouseListener(this); addKeyListener(this); }
/** *@fn MainWindow::on_testLoad_clicked()() *@brief Uruchamia okno wyboru pliku i zeruje nowy test */ void MainWindow::on_next_clicked() { if (iter < t.test.size() -1) { setMarked(iter); ++iter; loadQuestion(iter); } repaint(); }
CheckBox::CheckBox(const std::string &caption, bool marked) { setCaption(caption); setMarked(marked); setFocusable(true); addMouseListener(this); addKeyListener(this); adjustSize(); }
void Heap::getConservativeRegisterRoots(HashSet<JSCell*>& roots) { ASSERT(isValidThreadState(m_vm)); ConservativeRoots stackRoots(&m_objectSpace.blocks(), &m_storageSpace); stack().gatherConservativeRoots(stackRoots); size_t stackRootCount = stackRoots.size(); JSCell** registerRoots = stackRoots.roots(); for (size_t i = 0; i < stackRootCount; i++) { setMarked(registerRoots[i]); roots.add(registerRoots[i]); } }
/** *@fn MainWindow::on_clearTest_clicked() *@brief wyczyszczenie odpowiedzi na jedno pytanie */ void MainWindow::on_getMark_clicked() { QMessageBox msgBox; int ret = -2; setMarked(iter); for(int i = 0; i < t.test.size(); ++i) { if (t.test[i].marked == -1) { msgBox.setText("Nie odpowiedziałeś na wszystkie pytania!"); msgBox.setInformativeText("Brak odpowiedzi na niektóre pytania wyraźnie obniży Twoją ocenę."); msgBox.setModal(true); msgBox.setWindowTitle("Uwaga!"); QPushButton *sureButton = msgBox.addButton(tr("Oceń mimo to"), QMessageBox::YesRole); QPushButton *backButton = msgBox.addButton(tr("Powrót do testu"),QMessageBox::NoRole); msgBox.setDefaultButton(backButton); ret = msgBox.exec(); std::cout<<ret; if (ret == 1) return; else break; } } if (ret== -2) { msgBox.setText("Czy na pewno chcesz zakończyć test?"); msgBox.setInformativeText("Zostanie wystawiona ocena."); msgBox.setModal(true); msgBox.setWindowTitle("Uwaga!"); QPushButton *sureButton = msgBox.addButton(tr("Oceń"), QMessageBox::YesRole); QPushButton *backButton = msgBox.addButton(tr("Wróć do testu"),QMessageBox::NoRole); msgBox.setDefaultButton(backButton); int ret = msgBox.exec(); std::cout<<ret; if (ret == 1) return; } ui->helloLabel->setText(t.countMark()); ui->testing->setVisible(false); ui->reading->setVisible(true); this->resize(windowSize); ui->action_Otw_rz->setEnabled(true); ui->action_Rozpocznij_od_nowa->setDisabled(true); ui->action_Wyjd_bex_oceny->setDisabled(true); }
void Heap::getConservativeRegisterRoots(HashSet<JSCell*>& roots) { ASSERT(isValidThreadState(m_globalData)); if (m_operationInProgress != NoOperation) CRASH(); m_operationInProgress = Collection; ConservativeRoots registerFileRoots(&m_objectSpace.blocks()); registerFile().gatherConservativeRoots(registerFileRoots); size_t registerFileRootCount = registerFileRoots.size(); JSCell** registerRoots = registerFileRoots.roots(); for (size_t i = 0; i < registerFileRootCount; i++) { setMarked(registerRoots[i]); roots.add(registerRoots[i]); } m_operationInProgress = NoOperation; }
/** *@fn MainWindow::setMarked(int) *@brief Ustawia odpowiedź użytkownika według ui *@param questNr numer pytania */ void MainWindow::on_prev_clicked() { if (iter >= 0) { setMarked(iter); --iter; loadQuestion(iter); } if (iter < t.test.size() - 1) { ui->next->setDisabled(false); } if (iter == 0) { ui->prev->setDisabled(true); } repaint(); }
void MainWindow::on_clearTest_clicked() { clear(); setMarked(iter); repaint(); }