This commit is contained in:
BetaSteward 2010-09-01 03:01:43 +00:00
parent df642c2bd5
commit 3fa0e8b8f4
544 changed files with 13327 additions and 3074 deletions

View file

@ -41,7 +41,7 @@ import mage.players.Player;
*
* @author BetaSteward_at_googlemail.com
*/
public class FreeForAll extends GameImpl {
public class FreeForAll extends GameImpl<FreeForAll> {
private int numPlayers;
private List<UUID> mulliganed = new ArrayList<UUID>();
@ -50,6 +50,14 @@ public class FreeForAll extends GameImpl {
super(attackOption, range);
}
public FreeForAll(final FreeForAll game) {
super(game);
this.numPlayers = game.numPlayers;
for (UUID playerId: game.mulliganed) {
mulliganed.add(playerId);
}
}
@Override
public GameType getGameType() {
return new FreeForAllType();
@ -88,11 +96,16 @@ public class FreeForAll extends GameImpl {
numCards += 1;
mulliganed.add(playerId);
}
player.getLibrary().addAll(player.getHand());
player.getLibrary().addAll(player.getHand().getCards(this));
player.getHand().clear();
player.shuffleLibrary(this);
player.drawCards(numCards - 1, this);
fireInformEvent(player.getName() + " mulligans down to " + Integer.toString(numCards - 1) + " cards");
}
@Override
public FreeForAll copy() {
return new FreeForAll(this);
}
}