- Added new code for serialization/deserializaiton of full games including initial game and all the player actions.
- Added an undo menu using this code (beware, it's still very very alpha). - Removed various warning - Cleaned up avatar loading - Added full random lists load/save including the deck shuffling (not sure if I could not replace that with seed load/save) - Moved momir and Co rules configuration out of GameStateDuel - Create a GameType type to avoid mixing int everywhere
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
|
||||
#include "Rules.h"
|
||||
#include "MTGDefinitions.h"
|
||||
#include "Rules.h"
|
||||
#include "ManaCost.h"
|
||||
#include "Player.h"
|
||||
#include "AIMomirPlayer.h"
|
||||
@@ -303,6 +303,8 @@ Player * Rules::initPlayer(GameObserver *g, int playerId)
|
||||
return loadPlayerRandom(g, isAI, GAME_TYPE_RANDOM1);
|
||||
case GAME_TYPE_RANDOM2:
|
||||
return loadPlayerRandom(g, isAI, GAME_TYPE_RANDOM2);
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
//TODO p may still be NULL, what do we do to handle this? Above switch has no default case to handle the case where p is NULL
|
||||
@@ -385,7 +387,7 @@ void Rules::initGame(GameObserver *g)
|
||||
p->preventable = initState.playerData[i].player->preventable;
|
||||
if (initState.playerData[i].player->mAvatarName.size())
|
||||
{
|
||||
p->loadAvatar(initState.playerData[i].player->mAvatarName);
|
||||
p->mAvatarName = initState.playerData[i].player->mAvatarName;
|
||||
}
|
||||
MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay };
|
||||
MTGGameZone * loadedPlayerZones[] = { initState.playerData[i].player->game->graveyard,
|
||||
@@ -590,7 +592,7 @@ int Rules::load(string _filename)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Rules::strToGameMode(string s)
|
||||
GameType Rules::strToGameMode(string s)
|
||||
{
|
||||
if (s.compare("momir") == 0) return GAME_TYPE_MOMIR;
|
||||
if (s.compare("random1") == 0) return GAME_TYPE_RANDOM1;
|
||||
|
||||
Reference in New Issue
Block a user