void cElHJaFacette::ShowState() { if (TopState() == FBool::True) Show(0.0,P8COL::black,false); if (TopState() == FBool::MayBe) Show(0.0,P8COL::blue,false); if (TopState() == FBool::False) Show(0.0,P8COL::red,false); }
bool cElHJaFacette::SetFacetteGen(tBufFacette * aBuf,const FBool& aNewState,const FBool& aForbidSate) { if (TopState() == aForbidSate) { return true; } if (TopState() != aNewState) { Arrgt().AddStatistique(-std::abs(mSurf),TopState()); Arrgt().AddStatistique( std::abs(mSurf),aNewState); if (aBuf) aBuf->push_back(this); TopState() = aNewState; } return false; }
void Game::GameLoop(){ sf::Clock clock; while (window.isOpen()) { sf::Time elapsed = clock.restart(); float t = elapsed.asSeconds(); if (TopState() == nullptr){ continue; } TopState()->HandleInput(); //TopState()->Update(t); window.clear(); TopState()->Draw(t); window.display(); } }
void cElHJaFacette::SetSureIfPossible() { if (TopState() != FBool::MayBe) return; for (INT aK=0 ; aK<INT(mVFRecouvrt.size()) ; aK++) { if (mVFRecouvrt[aK]->TopState() != FBool::False) return; } // TopState() = FBool::True; SetFacetteSure(0); return; }
bool cElHJaFacette::PropageIncompVertGen(tBufFacette * aBuf,bool OnlyDessous) { if (TopState() != FBool::True) return false; for (INT aK=0 ; aK<INT(mVFRecouvrt.size()) ; aK++) { if ( (!OnlyDessous) || (mThisIsEnDessus[aK]) ) { if (mVFRecouvrt[aK]->SetFacetteImpossible(aBuf)) return true; } } return false; }
bool cElHJaFacette::PropageIcompVois(tBufFacette * aBuf) { if (TopState() != FBool::False) return false; for (INT aK=0 ; aK<INT(mVArcs.size()) ; aK++) { if ( mVFAdjcIncomp[aK] && (mVFAdjcIncomp[aK]->TopState()==FBool::False) ) { if (mVFAdjcPl[aK]->SetFacetteImpossible(aBuf) ) return true; if (mVFAdjcComp[aK]->SetFacetteImpossible(aBuf)) return true; } } return false; }
void cElHJaFacette::SetTopState(const FBool & aState) { TopState() = aState; }
bool cElHJaFacette::IsImpossible() { return (TopState()==FBool::False); }
bool cElHJaFacette::IsIndeterminee() { return (TopState()==FBool::MayBe); }
bool cElHJaFacette::IsSure() { return (TopState()==FBool::True); }