void MainWindow::on_pushButtonDoorOne_clicked(bool checked) { ui->pushButtonDoorOne->setStyleSheet("QPushButton{border-image:url(:/Slike/VrataZaprtaSelected.jpg); position: relative}"); qDebug() << "One clicked."; UserSelectedDoor = 0; DoWork(); }
static block_t *Convert( filter_t *p_filter, block_t *p_block ) { if( !p_block || !p_block->i_nb_samples ) { if( p_block ) block_Release( p_block ); return NULL; } size_t i_out_size = p_block->i_nb_samples * p_filter->fmt_out.audio.i_bitspersample * p_filter->fmt_out.audio.i_channels / 8; block_t *p_out = filter_NewAudioBuffer( p_filter, i_out_size ); if( !p_out ) { msg_Warn( p_filter, "can't get output buffer" ); block_Release( p_block ); return NULL; } p_out->i_nb_samples = p_block->i_nb_samples; p_out->i_dts = p_block->i_dts; p_out->i_pts = p_block->i_pts; p_out->i_length = p_block->i_length; DoWork( p_filter, p_block, p_out ); block_Release( p_block ); return p_out; }
void DoWorkLoop(int me) { MPI_Status status; int index; MPI_Send(&me, 1, MPI_INT, 0, TAG1, MPI_COMM_WORLD); while (1) { MPI_Recv(&index, 1, MPI_INT, 0, TAG1, MPI_COMM_WORLD, &status); if (index == -1) break; DoWork(index); MPI_Send(&me, 1, MPI_INT, 0, TAG1, MPI_COMM_WORLD); } std::list<Msg>::iterator mIter; for ( mIter = messages.begin(); mIter != messages.end(); mIter++) { MPI_Send(&me, 1, MPI_INT, 0, TAG1, MPI_COMM_WORLD); MPI_Send(mIter->r, 1, MPI_INT, 0, TAG1, MPI_COMM_WORLD); MPI_Send(mIter->result, mIter->r[1], MPI_CHAR, 0, TAG1, MPI_COMM_WORLD); delete [] mIter->result; } }
void TestTimer() { float b1 = r3dGetTime(); DWORD b2 = GetTickCount(); float t1 = r3dGetTime(); DWORD t2 = GetTickCount(); while(1) { ::Sleep(1); //(DWORD)u_GetRandom(10, 500)); DoWork(); float c1 = r3dGetTime(); DWORD c2 = GetTickCount(); // base delta float d1 = (c1 - b1) - (float)(c2 - b2)/1000.0f; // tick delta float d2 = (c1 - t1) - (float)(c2 - t2)/1000.0f; t1 = c1; t2 = c2; LARGE_INTEGER qwTicksPerSec; QueryPerformanceFrequency(&qwTicksPerSec ); r3dOutToLog("delta: %f, %f, %I64d\n", d1, d2, qwTicksPerSec ); } }
static block_t *Convert( filter_t *p_filter, block_t *p_block ) { if( !p_block || !p_block->i_nb_samples ) { if( p_block ) block_Release( p_block ); return NULL; } size_t i_out_size = p_block->i_nb_samples * p_filter->fmt_out.audio.i_bitspersample/8 * aout_FormatNbChannels( &(p_filter->fmt_out.audio) ); block_t *p_out = block_Alloc( i_out_size ); if( !p_out ) { msg_Warn( p_filter, "can't get output buffer" ); block_Release( p_block ); return NULL; } p_out->i_nb_samples = p_block->i_nb_samples; p_out->i_dts = p_block->i_dts; p_out->i_pts = p_block->i_pts; p_out->i_length = p_block->i_length; DoWork( p_filter, p_block, p_out ); block_Release( p_block ); return p_out; }
void UpdateAI(uint32 diff) override { if (_timer <= diff) DoWork(); else _timer -= diff; }
LRESULT CProgressDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { LVCOLUMN rCol = { LVCF_FMT | LVCF_TEXT, LVCFMT_LEFT, 0, _T("Filename") }; // List control initialization. m_hList = GetDlgItem ( IDC_LIST ); ListView_InsertColumn ( m_hList, 0, &rCol ); rCol.mask |= LVCF_SUBITEM; rCol.pszText = _T("Result"); rCol.iSubItem = 1; ListView_InsertColumn ( m_hList, 1, &rCol ); ListView_SetColumnWidth ( m_hList, 0, LVSCW_AUTOSIZE_USEHEADER ); ListView_SetColumnWidth ( m_hList, 1, LVSCW_AUTOSIZE_USEHEADER ); // Show the window. CenterWindow ( m_pCmdInfo->hwnd ); ShowWindow ( SW_SHOW ); // Process all the files in the string list passed in to our constructor. DoWork(); // Enable the Close button, and disable the Stop button. ::EnableWindow ( GetDlgItem ( IDCANCEL ), TRUE ); ::EnableWindow ( GetDlgItem ( IDC_STOP ), FALSE ); return 1; // Let the system set the focus }
void UpdateAI(uint32 diff) override { if (m_timer <= diff) { m_timer = 1000; DoWork(); } else m_timer -= diff; }
void SignalThread::Run() { DoWork(); { EnterExit ee(this); if (main_) { main_->Post(this, ST_MSG_WORKER_DONE); } } }
void UpdateAI(uint32 diff) { if (timer <= diff) { timer = 1000; DoWork(); } else timer -= diff; }
void BXBGJob::ExecuteJob() { if (m_bCancelled) return; //LOG(LOG_LEVEL_DEBUG,"BXBGJob::ExecuteJob, running job %s (bgjob)", m_strDescription.c_str()); DoWork(); PostDoWork(); }
void WorkQueue::Run(void) { while (!stop) { pthread_mutex_lock(&wlock); if (!works) { pthread_mutex_lock(&executing_lock); wait_for_works = true; /* wake up PauseWork() if it's sleeping */ pthread_cond_signal(&paused_wait); pthread_mutex_unlock(&executing_lock); /* * sleeps until works're available. * wokeup by ScheduleWork() or FlushWork() or ~WorkQueue() */ pthread_cond_wait(&wcond, &wlock); pthread_mutex_lock(&executing_lock); wait_for_works = false; pthread_mutex_unlock(&executing_lock); } while (works) { struct list *entry = works; WorkableInterface *wi = static_cast<WorkableInterface *>(entry->data); works = __list_delete(works, entry); pthread_mutex_unlock(&wlock); /* * 1. if PauseWork() locks executing_lock right before Run() locks * the lock, Run() sends the paused signal and go to sleep. * 2. if Run() locks executing_lock first, DoWork() is called and * PausedWork() waits for paused_wait signal. Run() sends the * signal during next loop processing or at the end of loop * in case of works're not available. */ pthread_mutex_lock(&executing_lock); if (!executing) { pthread_cond_signal(&paused_wait); pthread_cond_wait(&executing_wait, &executing_lock); } pthread_mutex_unlock(&executing_lock); DoWork(wi); pthread_mutex_lock(&wlock); } pthread_mutex_unlock(&wlock); } }
// This method cleans up temporary files BOOL CErrorReportExporter::Finalize() { // Wait until worker thread exits. WaitForCompletion(); // If needed, restart the application DoWork(RESTART_APP); // Done OK return TRUE; }
void UpdateAI(uint32 diff) override { if (m_timer <= diff) { m_timer = 1000; DoWork(); } else m_timer -= diff; if (UpdateVictim()) DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) override { if (_timer <= diff) DoWork(); else _timer -= diff; if (!UpdateVictim()) return; DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) override { if (!CheckPlayerValid()) return; if (m_timer <= diff) { m_timer = 1000; DoWork(); } else m_timer -= diff; }
static block_t *Convert( filter_t *p_filter, block_t *p_block ) { aout_filter_t aout_filter; aout_buffer_t in_buf, out_buf; block_t *p_out; int i_out_size; if( !p_block || !p_block->i_samples ) { if( p_block ) p_block->pf_release( p_block ); return NULL; } i_out_size = p_block->i_samples * p_filter->fmt_out.audio.i_bitspersample * p_filter->fmt_out.audio.i_channels / 8; p_out = p_filter->pf_audio_buffer_new( p_filter, i_out_size ); if( !p_out ) { msg_Warn( p_filter, "can't get output buffer" ); p_block->pf_release( p_block ); return NULL; } p_out->i_samples = p_block->i_samples; p_out->i_dts = p_block->i_dts; p_out->i_pts = p_block->i_pts; p_out->i_length = p_block->i_length; aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys; aout_filter.input = p_filter->fmt_in.audio; aout_filter.input.i_format = p_filter->fmt_in.i_codec; aout_filter.output = p_filter->fmt_out.audio; aout_filter.output.i_format = p_filter->fmt_out.i_codec; in_buf.p_buffer = p_block->p_buffer; in_buf.i_nb_bytes = p_block->i_buffer; in_buf.i_nb_samples = p_block->i_samples; out_buf.p_buffer = p_out->p_buffer; out_buf.i_nb_bytes = p_out->i_buffer; out_buf.i_nb_samples = p_out->i_samples; DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf ); p_out->i_buffer = out_buf.i_nb_bytes; p_out->i_samples = out_buf.i_nb_samples; p_block->pf_release( p_block ); return p_out; }
void UpdateAI(uint32 diff) override { if (m_timer <= diff) { m_timer = urand(10000, 60000); DoWork(); } else m_timer -= diff; if (!UpdateVictim()) return; else DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) { if (m_timer < diff) { m_timer = 1000; DoWork(); } else m_timer -= diff; if (!UpdateVictim()) return; else DoMeleeAttackIfReady(); }
void UpdateAI(uint32 diff) override { if (m_timer < diff) { m_timer = 1000; if (m_phase) DoWork(); } else m_timer -= diff; if (!UpdateVictim()) return; DoMeleeAttackIfReady(); }
void mi::WorkTrack(CTrack *pt, float *pin, float *pout, int numsamples, int const mode) { do { int count = __min(numsamples, pt->Length - pt->Pos); if (count > 0) { if (mode == WM_NOIO) { if (pt->Feedback != 0) DoWorkNoInputNoOutput(pt->Buffer + pt->Pos, count, pt->Feedback, pt->Filter); } else if (mode == WM_WRITE) { if (pt->Feedback != 0) DoWorkNoInput(pout, pt->Buffer + pt->Pos, count, pt->WetOut, pt->Feedback, pt->Filter); else DoWorkNoInputNoFB(pout, pt->Buffer + pt->Pos, count, pt->WetOut, pt->Filter); } else if (mode == WM_READ) { if (pt->Feedback != 0) DoWorkNoOutput(pin, pt->Buffer + pt->Pos, count, pt->Feedback, pt->Filter); else DoWorkNoOutputNoFB(pin, pt->Buffer + pt->Pos, count); } else { if (pt->Feedback != 0) DoWork(pin, pout, pt->Buffer + pt->Pos, count, pt->WetOut, pt->Feedback, pt->Filter); else DoWorkNoFB(pin, pout, pt->Buffer + pt->Pos, count, pt->WetOut, pt->Filter); } pin += count; pout += count; numsamples -= count; pt->Pos += count; } if (pt->Pos == pt->Length) pt->Pos = 0; } while(numsamples > 0); }
static block_t *DoPitchWork( filter_t * p_filter, block_t * p_in_buf ) { filter_sys_t *p = p_filter->p_sys; float rate_shift = vlc_atomic_load_float( &p->rate_shift ); /* Set matching rates for resampler's output and scaletempo's input */ p->resampler->fmt_out.audio.i_rate = rate_shift; p_filter->fmt_in.audio.i_rate = rate_shift; /* Change rate, thus changing pitch */ p_in_buf = p->resampler->pf_audio_filter( p->resampler, p_in_buf ); /* Change tempo while preserving shifted pitch */ return DoWork( p_filter, p_in_buf ); }
/* * Entry point. */ int main(int argc, char** argv) { NulibState* pState = NULL; int32_t majorVersion, minorVersion, bugVersion; int result = 0; (void) NuGetVersion(&majorVersion, &minorVersion, &bugVersion, NULL, NULL); if (majorVersion != kNuVersionMajor || minorVersion < kNuVersionMinor) { fprintf(stderr, "ERROR: wrong version of NufxLib --" " wanted %d.%d.x, got %d.%d.%d.\n", kNuVersionMajor, kNuVersionMinor, majorVersion, minorVersion, bugVersion); goto bail; } #if 0 extern NuResult ErrorMessageHandler(NuArchive* pArchive, void* vErrorMessage); NuSetGlobalErrorMessageHandler(ErrorMessageHandler); #endif if (NState_Init(&pState) != kNuErrNone) { fprintf(stderr, "ERROR: unable to initialize globals\n"); exit(1); } gProgName = GetProgName(pState, argv[0]); if (ProcessOptions(pState, argc, argv) < 0) { result = 2; goto bail; } if (NState_ExtraInit(pState) != kNuErrNone) { fprintf(stderr, "ERROR: additional initialization failed\n"); exit(1); } result = DoWork(pState); if (result) printf("Failed.\n"); bail: NState_Free(pState); exit(result); }
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT nArgc) { // Create application object #ifndef _DEBUG try #endif { DoWork(strCmdLine); } #ifndef _DEBUG catch(Ogre::Exception &e) { Ogre::LogManager::getSingleton().logMessage(e.getDescription()); } #endif return 0; }
void MainMessageLoopExternalPump::OnScheduleWork(int64 delay_ms) { REQUIRE_MAIN_THREAD(); if (delay_ms == kTimerDelayPlaceholder && IsTimerPending()) { // Don't set the maximum timer requested from DoWork() if a timer event is // currently pending. return; } KillTimer(); if (delay_ms <= 0) { // Execute the work immediately. DoWork(); } else { // Never wait longer than the maximum allowed time. if (delay_ms > kMaxTimerDelay) delay_ms = kMaxTimerDelay; // Results in call to OnTimerTimeout() after the specified delay. SetTimer(delay_ms); } }
bool CProgressJob::DoModal() { m_progress = NULL; // get a progress dialog if we don't already have one if (m_progressDialog == NULL) { m_progressDialog = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); if (m_progressDialog == NULL) return false; } m_modal = true; // do the work bool result = DoWork(); // mark the progress dialog as finished (will close it) MarkFinished(); m_modal = false; return result; }
void UpdateAI(uint32 diff) override { DoWork(diff); //Always decrease our global cooldown first if (globalCooldown > diff) globalCooldown -= diff; else globalCooldown = 0; //Buff timer (only buff when we are alive and not in combat if (me->IsAlive() && !me->IsInCombat()) { if (buffTimer <= diff) { //Find a spell that targets friendly and applies an aura (these are generally buffs) SpellInfo const* info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA); if (info && !globalCooldown) { //Cast the buff spell DoCast(me, info->Id); //Set our global cooldown globalCooldown = GENERIC_CREATURE_COOLDOWN; //Set our timer to 10 minutes before rebuff buffTimer = 600000; } //Try again in 30 seconds else buffTimer = 30000; } else buffTimer -= diff; } //Return since we have no target if (!UpdateVictim()) return; // Make sure our attack is ready and we arn't currently casting if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false)) { //If we are within range melee the target if (me->IsWithinMeleeRange(me->GetVictim())) { bool healing = false; SpellInfo const* info = NULL; //Select a healing spell if less than 30% hp if (me->HealthBelowPct(30)) info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); //No healing spell available, select a hostile spell if (info) healing = true; else info = SelectSpell(me->GetVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE); //20% chance to replace our white hit with a spell if (info && urand(0, 99) < 20 && !globalCooldown) { //Cast the spell if (healing) DoCast(me, info->Id); else DoCastVictim(info->Id); //Set our global cooldown globalCooldown = GENERIC_CREATURE_COOLDOWN; } else me->AttackerStateUpdate(me->GetVictim()); me->resetAttackTimer(); } } else { //Only run this code if we arn't already casting if (!me->IsNonMeleeSpellCast(false)) { bool healing = false; SpellInfo const* info = NULL; //Select a healing spell if less than 30% hp ONLY 33% of the time if (me->HealthBelowPct(30) && 33 > urand(0, 99)) info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE) if (info) healing = true; else info = SelectSpell(me->GetVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE); //Found a spell, check if we arn't on cooldown if (info && !globalCooldown) { //If we are currently moving stop us and set the movement generator if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) { me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveIdle(); } //Cast spell if (healing) DoCast(me, info->Id); else DoCastVictim(info->Id); //Set our global cooldown globalCooldown = GENERIC_CREATURE_COOLDOWN; } //If no spells available and we arn't moving run to target else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) { //Cancel our current spell and then mutate new movement generator me->InterruptNonMeleeSpells(false); me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveChase(me->GetVictim()); } } } DoMeleeAttackIfReady(); }
void FOneSkyLocalizationServiceCommand::DoThreadedWork() { Concurrency = ELocalizationServiceOperationConcurrency::Asynchronous; DoWork(); }
int main() { srand(time(NULL)); std::cout << (DoWork() ? "ok" : "bad") << std::endl; return 0; }
AskAlert::AskAlert(ManageGame *Game, QString Name, QWidget *parent) : QWidget(parent){ onGoingGame = Game; BuildingName = Name; resize(300, 225); QPixmap Image; if(BuildingName == "Gym") Image.load(QString::fromUtf8("Resources/AskGym.png")); else if(BuildingName == "Lib") Image.load(QString::fromUtf8("Resources/AskLibrary.png")); else if(BuildingName == "Lab") Image.load(QString::fromUtf8("Resources/AskLabor.png")); else if(BuildingName == "Log") Image.load(QString::fromUtf8("Resources/AskLogHouse.png")); else if(BuildingName == "Stu") Image.load(QString::fromUtf8("Resources/AskStuHall.png")); else if(BuildingName == "Mar") Image.load(QString::fromUtf8("Resources/AskMarket.png")); /* Gym 내부 */ else if(BuildingName == "Exer") // 운동하는 것, building은 아님 Image.load(QString::fromUtf8("Resources/AskExercise.png")); else if(BuildingName == "GymUpgrade1") Image.load(QString::fromUtf8("Resources/AskUpgrade1.png")); else if(BuildingName == "GymUpgrade2") Image.load(QString::fromUtf8("Resources/AskUpgrade2.png")); /* Cafeteria 내부 */ else if(BuildingName == "B" || BuildingName == "C" || BuildingName == "D") // 운동하는 것, building은 아님 Image.load(QString::fromUtf8("Resources/AskEat.png")); else if(BuildingName == "CafUpgrade1") Image.load(QString::fromUtf8("Resources/AskUpgrade1.png")); else if(BuildingName == "CafUpgrade2") Image.load(QString::fromUtf8("Resources/AskUpgrade2.png")); /* Market 내부 */ else if(BuildingName == "Drink1" || BuildingName == "Drink2" || BuildingName == "Drink3") // 운동하는 것, building은 아님 Image.load(QString::fromUtf8("Resources/AskDrink.png")); else if(BuildingName == "MarUpgrade1") Image.load(QString::fromUtf8("Resources/AskUpgrade1_Market.png")); else if(BuildingName == "MarUpgrade2") Image.load(QString::fromUtf8("Resources/AskUpgrade2_Market.png")); /* LogHouse 내부 */ else if(BuildingName == "LogA" || BuildingName == "LogB" || BuildingName == "LogC") // 운동하는 것, building은 아님 Image.load(QString::fromUtf8("Resources/AskLog.png")); else if(BuildingName == "LogUpgrade1") Image.load(QString::fromUtf8("Resources/AskUpgrade1.png")); else if(BuildingName == "LogUpgrade2") Image.load(QString::fromUtf8("Resources/AskUpgrade2.png")); /* StudentHall 내부 */ else if(BuildingName == "clubA" || BuildingName == "clubB" || BuildingName == "clubC") // 운동하는 것, building은 아님 Image.load(QString::fromUtf8("Resources/AskClub.png")); else if(BuildingName == "StuUpgrade1") Image.load(QString::fromUtf8("Resources/AskUpgrade1.png")); else if(BuildingName == "StuUpgrade2") Image.load(QString::fromUtf8("Resources/AskUpgrade2.png")); // Library 내부 else if(BuildingName == "Study") Image.load(QString::fromUtf8("Resources/AskStudy.png")); else if(BuildingName == "LibUpgrade1") Image.load(QString::fromUtf8("Resources/AskUpgrade1.png")); else if(BuildingName == "LibUpgrade2") Image.load(QString::fromUtf8("Resources/AskUpgrade2.png")); // Labor 내부 else if(BuildingName == "Work") Image.load(QString::fromUtf8("Resources/AskWork.png")); else if(BuildingName == "LabUpgrade1") Image.load(QString::fromUtf8("Resources/AskUpgrade1.png")); else if(BuildingName == "LabUpgrade2") Image.load(QString::fromUtf8("Resources/AskUpgrade2.png")); else if(BuildingName == "DF") Image.load(QString::fromUtf8("Resources/AskDrunkenFriend.png")); else if(BuildingName == "S") Image.load(QString::fromUtf8("Resources/AskSeniorFriend.png")); else if(BuildingName == "SF") Image.load(QString::fromUtf8("Resources/AskHealthyFriend.png")); else if(BuildingName == "TF") Image.load(QString::fromUtf8("Resources/AskStudyFriend.png")); else if(BuildingName == "LO") Image.load(QString::fromUtf8("Resources/AskLoverFriend.png")); askalert = new QLabel(this); askalert->setScaledContents(true); askalert->setGeometry(QRect(0, 0, 300, 225)); askalert->setPixmap(Image); font = new QFont( "Resources/NanumBarunGothic.ttp"); font->setKerning( true ); font->setBold( true ); font->setPixelSize( 20 ); Yes = new QPushButton(askalert); Yes->setGeometry(QRect(30, 170, 100, 45)); QIcon YesIcon; YesIcon.addPixmap(QPixmap(QString::fromUtf8("Resources/Yes.png")), QIcon::Normal, QIcon::Off); Yes->setIcon(YesIcon); Yes->setIconSize(QSize(90, 36)); Yes->setFlat(true); Yes->show(); No = new QPushButton(askalert); No->setGeometry(QRect(170, 170, 100, 45)); QIcon NoIcon; NoIcon.addPixmap(QPixmap(QString::fromUtf8("Resources/No.png")), QIcon::Normal, QIcon::Off); No->setIcon(NoIcon); No->setIconSize(QSize(90, 36)); No->setFlat(true); No->show(); askalert->show(); if(BuildingName == "Gym") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildGym())); else if(BuildingName == "Lib") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildLibrary())); else if(BuildingName == "Lab") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildLaborBuilding())); else if(BuildingName == "Log") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildLogHouse())); else if(BuildingName == "Stu") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildStudentHall())); else if(BuildingName == "Mar") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildMarket())); else if(BuildingName == "Exer") // Gym QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(DoExer())); else if(BuildingName == "GymUpgrade1" || BuildingName == "GymUpgrade2") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildGym())); else if(BuildingName == "B" ) // Cafeteria QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(EatB())); else if(BuildingName == "C" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(EatC())); else if(BuildingName == "D" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(EatD())); else if(BuildingName == "CafUpgrade1" || BuildingName == "CafUpgrade2") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildCafeteria())); else if(BuildingName == "Drink1" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(Drink1())); else if(BuildingName == "Drink2" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(Drink2())); else if(BuildingName == "Drink3" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(Drink3())); else if(BuildingName == "MarUpgrade1" || BuildingName == "MarUpgrade2") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildMarket())); else if(BuildingName == "LogA" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(LogA())); else if(BuildingName == "LogB" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(LogB())); else if(BuildingName == "LogC" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(LogC())); else if(BuildingName == "LogUpgrade1" || BuildingName == "LogUpgrade2") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildLogHouse())); else if(BuildingName == "clubA" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(ClubA())); else if(BuildingName == "clubB" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(ClubB())); else if(BuildingName == "clubC" ) QObject::connect(Yes, SIGNAL(clicked()), this ,SLOT(ClubC())); else if(BuildingName == "StuUpgrade1" || BuildingName == "StuUpgrade2") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildStudentHall())); else if(BuildingName == "Study") // Library QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(DoStudy())); else if(BuildingName == "LibUpgrade1" || BuildingName == "LibUpgrade2") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildLibrary())); else if(BuildingName == "Work") // Labor QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(DoWork())); else if(BuildingName == "LabUpgrade1" || BuildingName == "LabUpgrade2") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildLaborBuilding())); else if(BuildingName == "Work") // Labor QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(DoWork())); else if(BuildingName == "LabUpgrade1" || BuildingName == "LabUpgrade2") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame,SLOT(BuildLaborBuilding())); else if(BuildingName == "DF" ) QObject::connect(Yes, SIGNAL(clicked()), onGoingGame ,SLOT(MakeDF())); else if(BuildingName == "S" ) QObject::connect(Yes, SIGNAL(clicked()), onGoingGame ,SLOT(MakeS())); else if(BuildingName == "SF" ) QObject::connect(Yes, SIGNAL(clicked()), onGoingGame ,SLOT(MakeSF())); else if(BuildingName == "TF") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame ,SLOT(MakeTF())); else if(BuildingName == "LO") QObject::connect(Yes, SIGNAL(clicked()), onGoingGame ,SLOT(MakeLO())); if(BuildingName == "GymUpgrade1" || BuildingName == "GymUpgrade2" || BuildingName == "Exer") QObject::connect(No, SIGNAL(clicked()), onGoingGame, SLOT(NothingInGym())); else if(BuildingName == "LibUpgrade1" || BuildingName == "LibUpgrade2" || BuildingName == "Study") QObject::connect(No, SIGNAL(clicked()), onGoingGame, SLOT(NothingInLib())); else if(BuildingName == "LabUpgrade1" || BuildingName == "LabUpgrade2" || BuildingName == "Work") QObject::connect(No, SIGNAL(clicked()), onGoingGame, SLOT(NothingInLab())); else if(BuildingName == "CafUpgrade1" || BuildingName == "CafUpgrade2" || BuildingName == "B" || BuildingName == "C" || BuildingName == "D"){ QObject::connect(No, SIGNAL(clicked()), onGoingGame, SLOT(NothingInCaf())); } else if(BuildingName == "MarUpgrade1" || BuildingName == "MarUpgrade2" || BuildingName == "Drink1" || BuildingName == "Drink2" || BuildingName == "Drink3"){ QObject::connect(No, SIGNAL(clicked()), onGoingGame, SLOT(NothingInMar())); } else if(BuildingName == "LogUpgrade1" || BuildingName == "LogUpgrade2" || BuildingName == "LogA" || BuildingName == "LogB" || BuildingName == "LogC"){ QObject::connect(No, SIGNAL(clicked()), onGoingGame, SLOT(NothingInMar())); } else if(BuildingName == "StuUpgrade1" || BuildingName == "StuUpgrade2" || BuildingName == "clubA" || BuildingName == "clubB" || BuildingName == "clubC"){ QObject::connect(No, SIGNAL(clicked()), onGoingGame, SLOT(NothingInStu())); } else{ QObject::connect(No, SIGNAL(clicked()), onGoingGame, SLOT(NoBuild())); } }