From 229850b4b2c63fc3aff801ab3a3c408955207fbf Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 13:13:07 +0000 Subject: [PATCH] delete unused code from the old PlayerLife type. --- src/forge/AllZone.java | 6 ------ src/forge/CardFactory_Creatures.java | 6 +++--- src/forge/CardFactory_Instants.java | 1 - src/forge/CardFactory_Sorceries.java | 8 +------- src/forge/GameAction.java | 1 - src/forge/GameActionUtil.java | 9 +-------- 6 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/forge/AllZone.java b/src/forge/AllZone.java index 02c07a0a221..c18b0c25dad 100644 --- a/src/forge/AllZone.java +++ b/src/forge/AllZone.java @@ -43,12 +43,6 @@ public class AllZone implements NewConstants { public static Combat Combat = new Combat(); public static Combat pwCombat = new Combat();//for Planeswalker combat - //public static PlayerLife Human_Life = new PlayerLife(AllZone.HumanPlayer); - //public static PlayerLife ComputerPlayer = new PlayerLife(AllZone.ComputerPlayer); - - //public static PlayerPoisonCounter Human_PoisonCounter = new PlayerPoisonCounter(); - //public static PlayerPoisonCounter ComputerPlayer = new PlayerPoisonCounter(); - //Human_Play, Computer_Play is different because Card.comesIntoPlay() is called when a card is added by PlayerZone.add(Card) public final static PlayerZone Human_Play = new PlayerZone_ComesIntoPlay(Constant.Zone.Play, AllZone.HumanPlayer); public final static PlayerZone Human_Hand = new DefaultPlayerZone(Constant.Zone.Hand , AllZone.HumanPlayer); diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 03a7849550e..87287c8e4b4 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -5201,12 +5201,12 @@ public class CardFactory_Creatures { public boolean canPlayAI() { return false; - /** + /* CardList Clist = new CardList(AllZone.getZone(Constant.Zone.Play, AllZone.ComputerPlayer).getCards()).getType("Creature"); CardList Hlist = new CardList(AllZone.getZone(Constant.Zone.Play, AllZone.HumanPlayer).getCards()).getType("Creature"); - return((Clist.size() - Hlist.size() * ComputerUtil.getAvailableMana().size() > AllZone.GameAction.getPlayerLife(AllZone.HumanPlayer).getLife()) + return((Clist.size() - Hlist.size() * ComputerUtil.getAvailableMana().size() > AllZone.HumanPlayer.getLife()) && AllZone.Phase.getPhase().equals(Constant.Phase.Main1)); - **/ + */ } }; diff --git a/src/forge/CardFactory_Instants.java b/src/forge/CardFactory_Instants.java index 1d1a63185f9..1263f67c93d 100644 --- a/src/forge/CardFactory_Instants.java +++ b/src/forge/CardFactory_Instants.java @@ -2415,7 +2415,6 @@ public class CardFactory_Instants { @Override public boolean canPlayAI() { - //PlayerLife compLife = AllZone.GameAction.getPlayerLife(AllZone.ComputerPlayer); int life = AllZone.ComputerPlayer.getLife(); if(4 < AllZone.Phase.getTurn() && AllZone.Computer_Library.size() > 0 && life >= 4) return true; else return false; diff --git a/src/forge/CardFactory_Sorceries.java b/src/forge/CardFactory_Sorceries.java index 512495380ce..c29683d4e5c 100644 --- a/src/forge/CardFactory_Sorceries.java +++ b/src/forge/CardFactory_Sorceries.java @@ -944,8 +944,7 @@ public class CardFactory_Sorceries { } // Resolve public boolean canPlayAI() { - Player opponent = card.getController().getOpponent(); - //PlayerLife target = AllZone.GameAction.getPlayerLife(opponent); + Player opponent = card.getController().getOpponent(); PlayerZone Lib = AllZone.getZone(Constant.Zone.Library, card.getController()); CardList Deck = new CardList(); Deck.addAll(Lib.getCards()); @@ -3548,7 +3547,6 @@ public class CardFactory_Sorceries { @Override public boolean canPlayAI() { - //PlayerLife compLife = AllZone.GameAction.getPlayerLife(AllZone.ComputerPlayer); int life = AllZone.ComputerPlayer.getLife(); if(4 < AllZone.Phase.getTurn() && AllZone.Computer_Library.size() > 0 && life >= 4) return true; else return false; @@ -3636,8 +3634,6 @@ public class CardFactory_Sorceries { CardList libCards = new CardList(library.getCards()); int lifeGain = libCards.size(); - //PlayerLife compLife = AllZone.GameAction.getPlayerLife(AllZone.ComputerPlayer); - if(lifeGain > AllZone.ComputerPlayer.getLife()) return true; else return false; } @@ -5836,8 +5832,6 @@ public class CardFactory_Sorceries { @Override public boolean canPlayAI() { - //PlayerLife compLife = AllZone.GameAction.getPlayerLife(AllZone.ComputerPlayer); - //PlayerLife humanLife = AllZone.GameAction.getPlayerLife(AllZone.HumanPlayer); CardList human = AllZoneUtil.getPlayerLandsInPlay(AllZone.HumanPlayer); CardList comp = AllZoneUtil.getPlayerLandsInPlay(AllZone.ComputerPlayer); diff --git a/src/forge/GameAction.java b/src/forge/GameAction.java index 78e020feb5c..4d029017ff6 100644 --- a/src/forge/GameAction.java +++ b/src/forge/GameAction.java @@ -1457,7 +1457,6 @@ public class GameAction { public void execute() { if(Whenever_Go(F_card,F_k) == true) if(AllZone.GameAction.isCardInZone(F_card,Required_Zone) || F_Zones.equals("Any")) { - //PlayerLife life = AllZone.GameAction.getPlayerLife(F_TargetPlayer[F_Target]); if(F_Amount[0] > -1) F_TargetPlayer[F_Target].gainLife(F_Amount[0], F_card); else diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 982b92b7ad9..5db4e2ce8e9 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -1637,7 +1637,6 @@ public class GameActionUtil { }// if choice yes else target = AllZone.HumanPlayer; // check for target of spell/abilities should be here } else target = AllZone.HumanPlayer; // check for target of spell/abilities should be here - //AllZone.GameAction.getPlayerLife(target).loseLife(1,card); target.loseLife(1, card); card.getController().gainLife(1, card); @@ -6776,7 +6775,6 @@ public class GameActionUtil { + "Turn: " + AllZone.Phase.getTurn()); if(libraryZone.size() == 0 && AllZone.Phase.getPhase().equals(Constant.Phase.Untap) && AllZone.Phase.getTurn() > 1) { - //PlayerLife life = AllZone.GameAction.getPlayerLife(player); player.setLife(0, null); // TODO display this somehow!!! }// if @@ -9333,11 +9331,7 @@ public class GameActionUtil { private static void upkeep_Convalescence() { final Player player = AllZone.Phase.getPlayerTurn(); - PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player); - //final PlayerLife pLife = AllZone.GameAction.getPlayerLife(player); - - CardList list = new CardList(playZone.getCards()); - list = list.getName("Convalescence"); + CardList list = AllZoneUtil.getPlayerCardsInPlay(player, "Convalescence"); for(int i = 0; i < list.size(); i++) { final Card source = list.get(i); @@ -9846,7 +9840,6 @@ public class GameActionUtil { * At the beginning of your upkeep, if you have exactly 1 life, you win the game. */ final Player player = AllZone.Phase.getPlayerTurn(); - //PlayerLife life = AllZone.GameAction.getPlayerLife(player); CardList list = AllZoneUtil.getPlayerCardsInPlay(player, "Near-Death Experience");