- 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

@@ -173,7 +173,7 @@ void Credits::compute(GameObserver* g, GameApp * _app)
return;
PlayerData * playerdata = NEW PlayerData(MTGCollection());
if (p2->isAI() && p1 != g->gameOver)
if (p2->isAI() && g->didWin(p1))
{
gameLength = time(0) - g->startedAt;
value = 400;
@@ -367,7 +367,7 @@ void Credits::Render()
{
if (!p1->isAI() && p2->isAI())
{
if (observer->gameOver != p1)
if (observer->didWin(p1))
{
sprintf(buffer, _("Congratulations! You earn %i credits").c_str(), value);
JQuadPtr unlockedQuad = GetUnlockedQuad(unlockedTextureName);
@@ -389,7 +389,7 @@ void Credits::Render()
else
{
int winner = 2;
if (observer->gameOver != p1)
if (observer->didWin(p1))
{
winner = 1;
}
@@ -412,7 +412,7 @@ void Credits::Render()
y += 15;
//!!
if (observer->gameOver != p1 && this->gameLength != 0)
if (observer->didWin(p1) && this->gameLength != 0)
{
sprintf(buffer, _("Game length: %i turns (%i seconds)").c_str(), observer->turn, this->gameLength);
f->DrawString(buffer, 10, y);