- modified gameOver to be protected and defined two new operations to do the same thing (didWin and setLoser)

- removed ACTION_LOGGING_TESTING code
- Fixed AIvsAI games multithreaded games
- Activated undo when testsuite is enable
- Defined an initial player comparison operator
- Fixed multi-threaded modification to subtypes
- Fixed gameTurn cleanup for gameObserver reuse
This commit is contained in:
Xawotihs@gmail.com
2012-03-20 23:10:05 +00:00
parent 865bc7e494
commit cb8af6d6c0
14 changed files with 80 additions and 58 deletions

View File

@@ -77,7 +77,7 @@ int TestSuiteAI::displayStack()
int TestSuiteAI::Act(float dt)
{
observer->gameOver = NULL; // Prevent draw rule from losing the game
observer->setLoser(NULL); // Prevent draw rule from losing the game
//Last bits of initialization require to be done here, after the first "update" call of the game
@@ -123,7 +123,7 @@ int TestSuiteAI::Act(float dt)
{
//end of game
suite->assertGame();
observer->gameOver = observer->players[0];
observer->setLoser(observer->players[0]);
DebugTrace("================================ END OF TEST =======================\n");
return 1;
}
@@ -764,9 +764,9 @@ void TestSuite::ThreadProc(void* inParam)
theGame.observer->startGame(theGame.gameType, instance->mRules);
theGame.initGame();
while(!theGame.observer->gameOver)
while(!theGame.observer->didWin())
theGame.observer->Update(counter++);
/*
if(theGame.observer->gameType() != GAME_TYPE_MOMIR)
{
stringstream stream;
@@ -774,6 +774,7 @@ void TestSuite::ThreadProc(void* inParam)
theGame.observer->load(stream.str(), false, &theGame);
theGame.assertGame();
}
*/
}
}
}