- Moved the card collection out of the GameApp class to clean up the dependencies

- Added method to build a card collection independently of the GUI to ease my unitary test application
- Added part of some network GUI I'm working on, it's #ifdef out, I'm only committing this part to ease later merges
- Added the beginning of a serialization code of the Player and related classes used for network support
- various other minor cleanup
This commit is contained in:
Xawotihs
2011-02-06 11:35:40 +00:00
parent 91a2cb9c90
commit b7b584113b
26 changed files with 268 additions and 137 deletions
+2 -3
View File
@@ -49,7 +49,7 @@ void Credits::compute(Player * _p1, Player * _p2, GameApp * _app)
GameObserver * g = GameObserver::GetInstance();
if (!g->turn)
return;
PlayerData * playerdata = NEW PlayerData(app->collection);
PlayerData * playerdata = NEW PlayerData(MTGCollection());
if (!p1->isAI() && p2->isAI() && p1 != g->gameOver)
{
gameLength = time(0) - g->startedAt;
@@ -383,8 +383,7 @@ int Credits::addCardToCollection(int cardId, MTGDeck * collection)
*/
int Credits::addCardToCollection(int cardId)
{
MTGAllCards * ac = GameApp::collection;
PlayerData * playerdata = NEW PlayerData(ac);
PlayerData * playerdata = NEW PlayerData(MTGCollection());
int result = addCardToCollection(cardId, playerdata->collection);
playerdata->collection->save();
return result;