Isola::Isola(const Color& p1, const Color& p2, const unsigned short& w, const unsigned short& h) :BoardGame(w, h, p1, p2), mP1(w/2, h-1), mP2(w/2, 0) { std::cerr<<"ISOLA : "<<w<<"*"<<h<<" - "<<p1<<" vs "<<p2<<std::endl; mMoved = false; mBoard.at( mP1.fst(), mP1.snd() ) = mPlayer1.getColor(); mBoard.at( mP2.fst(), mP2.snd() ) = mPlayer2.getColor(); mScore[0] = 0; mScore[1] = 0; mCurrentPlayer = &mPlayer1; mCurrent = mP1; mPointer = mCurrent; mSucc_function = [this](Board b, const Point& pos, const Player& pl) -> bool{ return isSucc(b, pos, pl); }; mIngame = true; }
void TextResultPrinter::endTest(const Test& test) { auto lastest = tests.top(); lastest->isSucc() ? onTestSucc(test) : onTestFail(test, lastest->isFailure()); auto elapsed = tests.top()->elapsedTime(); out << WHITE << test.getName() << toString(elapsed) << std::endl; collectTime(elapsed); tests.pop(); }