moved mulligan code out of GameStateDuel and into Player base class. Taking a mulligan seems better

encapsulated as a player function rather than loose code inside the state transitions of GameStateDuel

Note: Inside of the mulligan code I assigned game to currentPlayerZones for clarification rather than
something functionally required.  "game" seems ambiguous as "game" is also referenced throughout the code for the GameObserver
keeping this change localized to this method until more analysis can be done.  The pattern that was here before was
game->currentPlayer->game
where the first "game" represented the GameObserver and the second the collection of zones (MTPPlayerCards) to the current player.
I would suggest changing the Player instance of game to something that represents its data, the game zones associated to the current player.
"game" seems too generic, as it can be interpreted to encompass many things rather than just dealing with the different zones (library, exile, discard, etc )
This commit is contained in:
techdragon.nguyen@gmail.com
2011-01-28 13:30:29 +00:00
parent 3187487987
commit 5e651f03b2
3 changed files with 110 additions and 102 deletions
+2
View File
@@ -73,6 +73,8 @@ public:
void unTapPhase();
MTGInPlay * inPlay();
ManaPool * getManaPool();
void takeMulligan();
void cleanupPhase();
virtual int Act(float dt)
{