move more small stuff from GameAction to Player

This commit is contained in:
jendave
2011-08-06 09:39:10 +00:00
parent 9b9b834b58
commit e131d1efd5
3 changed files with 15 additions and 12 deletions

View File

@@ -274,7 +274,7 @@ public class ComputerAI_General implements Computer {
c.setDefendingPlayer(AllZone.Combat.getDefendingPlayer());
//check for planeswalker
Card walker = AllZone.GameAction.getPlaneswalker(AllZone.HumanPlayer);
Card walker = AllZone.HumanPlayer.getPlaneswalker();
if(walker != null && MyRandom.random.nextBoolean()) {
c.setPlaneswalker(walker);

View File

@@ -24,17 +24,6 @@ public class GameAction {
//private boolean fantasyQuest = false;
//returns null if player does not have a Planeswalker
public Card getPlaneswalker(Player player) {
PlayerZone p = AllZone.getZone(Constant.Zone.Play, player);
CardList c = new CardList(p.getCards());
c = c.getType("Planeswalker");
if(c.isEmpty()) return null;
return c.get(0);
}
public void resetActivationsPerTurn(){
CardList all = AllZoneUtil.getCardsInGame();

View File

@@ -358,6 +358,20 @@ public abstract class Player extends MyObservable{
doScry(topN, topN.size());
}
///////////////////////////////
///////////////////////////////
////
//// properties about the player and his/her cards/game status
////
///////////////////////////////
public boolean hasPlaneswalker() {
return null != getPlaneswalker();
}
public Card getPlaneswalker() {
CardList c = AllZoneUtil.getPlayerTypeInPlay(this, "Planeswalker");
return c.get(0);
}
////////////////////////////////
//