HumanPlayer.java removed, references cast to Player

This commit is contained in:
Maxmtg
2013-05-12 18:18:41 +00:00
parent 3327ac3f4b
commit a1ecabccf8
13 changed files with 17 additions and 56 deletions

1
.gitattributes vendored
View File

@@ -14242,7 +14242,6 @@ src/main/java/forge/game/phase/package-info.java svneol=native#text/plain
src/main/java/forge/game/player/AIPlayer.java svneol=native#text/plain
src/main/java/forge/game/player/GameLossReason.java -text
src/main/java/forge/game/player/HumanPlay.java -text
src/main/java/forge/game/player/HumanPlayer.java svneol=native#text/plain
src/main/java/forge/game/player/LobbyPlayer.java -text
src/main/java/forge/game/player/LobbyPlayerAi.java -text
src/main/java/forge/game/player/LobbyPlayerHuman.java -text

View File

@@ -24,7 +24,6 @@ import forge.control.input.InputSelectCardsFromList;
import forge.game.GameState;
import forge.game.ai.ComputerUtilCard;
import forge.game.player.AIPlayer;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.game.zone.Zone;
import forge.game.zone.ZoneType;
@@ -599,7 +598,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
if (decider instanceof AIPlayer) {
ChangeZoneAi.hiddenOriginResolveAI(decider, sa, player);
} else {
changeHiddenOriginResolveHuman((HumanPlayer) decider, sa, player);
changeHiddenOriginResolveHuman(decider, sa, player);
}
}
}
@@ -616,7 +615,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
* @param player
* a {@link forge.game.player.Player} object.
*/
private static void changeHiddenOriginResolveHuman(final HumanPlayer decider, final SpellAbility sa, Player player) {
private static void changeHiddenOriginResolveHuman(final Player decider, final SpellAbility sa, Player player) {
final Card card = sa.getSourceCard();
final List<Card> movedCards = new ArrayList<Card>();
final boolean defined = sa.hasParam("Defined");

View File

@@ -26,7 +26,6 @@ import forge.card.spellability.SpellAbility;
import forge.card.spellability.Target;
import forge.game.GameState;
import forge.game.ai.ComputerUtilCard;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.game.zone.ZoneType;
import forge.gui.GuiChoose;
@@ -212,7 +211,7 @@ public class CopyPermanentEffect extends SpellAbilityEffect {
}
if (!list.isEmpty()) {
Card attachedTo = null;
if (sa.getActivatingPlayer() instanceof HumanPlayer) {
if (sa.getActivatingPlayer().isHuman()) {
if (list.size() > 1) {
attachedTo = GuiChoose.one(copy + " - Select a card to attach to.", list);
} else {

View File

@@ -8,7 +8,6 @@ import forge.card.ability.AbilityUtils;
import forge.card.ability.SpellAbilityEffect;
import forge.card.spellability.SpellAbility;
import forge.card.spellability.Target;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.gui.GuiChoose;
@@ -38,7 +37,7 @@ public class LifeSetEffect extends SpellAbilityEffect {
p.setLife(lifeAmount, sa.getSourceCard());
} else {
int life;
if (sa.getActivatingPlayer() instanceof HumanPlayer) {
if (sa.getActivatingPlayer().isHuman()) {
life = GuiChoose.one("Life Total: " + p, lifetotals);
} else {//AI
if (p.equals(sa.getSourceCard().getController())) {

View File

@@ -35,7 +35,7 @@ import forge.Singletons;
import forge.control.KeyboardShortcuts.Shortcut;
import forge.game.MatchController;
import forge.game.ai.AiProfileUtil;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.gui.SOverlayUtils;
import forge.gui.deckeditor.CDeckEditorUI;
import forge.gui.deckeditor.VDeckEditorUI;
@@ -285,8 +285,8 @@ public enum FControl {
}
/** @return {@link forge.game.player.Player} */
private HumanPlayer localPlayer;
public HumanPlayer getPlayer() {
private Player localPlayer;
public Player getPlayer() {
return localPlayer;
}
@@ -306,7 +306,7 @@ public enum FControl {
* TODO: Write javadoc for this method.
* @param localHuman
*/
public void setPlayer(HumanPlayer localHuman) {
public void setPlayer(Player localHuman) {
localPlayer = localHuman;
}

View File

@@ -27,7 +27,6 @@ import forge.game.GameType;
import forge.game.MatchController;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.game.player.PlayerController;
import forge.game.zone.MagicStack;
@@ -127,7 +126,7 @@ public class InputQueue extends MyObservable implements java.io.Serializable {
public final Input getActualInput(GameState game) {
GameAge age = game.getAge();
if ( age == GameAge.Mulligan ) {
HumanPlayer human = Singletons.getControl().getPlayer();
Player human = Singletons.getControl().getPlayer();
return game.getType() == GameType.Commander ? new InputPartialParisMulligan(match, human) : new InputMulligan(match, human);
}

View File

@@ -74,7 +74,6 @@ import forge.game.event.CardDamagedEvent;
import forge.game.event.LifeLossEvent;
import forge.game.player.AIPlayer;
import forge.game.player.HumanPlay;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.game.zone.ZoneType;
import forge.gui.GuiChoose;
@@ -283,7 +282,7 @@ public final class GameActionUtil {
if (p.isHuman()) {
if (GuiDialog.confirm(rippledCards[i], "Cast " + rippledCards[i].getName() + "?")) {
HumanPlay.playCardWithoutPayingManaCost(((HumanPlayer)p), rippledCards[i]);
HumanPlay.playCardWithoutPayingManaCost(p, rippledCards[i]);
revealed.remove(rippledCards[i]);
}
} else {

View File

@@ -19,7 +19,6 @@ import forge.deck.Deck;
import forge.error.BugReporter;
import forge.game.event.DuelOutcomeEvent;
import forge.game.event.FlipCoinEvent;
import forge.game.player.HumanPlayer;
import forge.game.player.LobbyPlayer;
import forge.game.player.LobbyPlayerHuman;
import forge.game.player.Player;
@@ -166,11 +165,11 @@ public class MatchController {
GameState currentGame = match.getCurrentGame();
currentGame.getEvents().register(Singletons.getControl().getSoundSystem());
HumanPlayer localHuman = null;
Player localHuman = null;
for(Player p : currentGame.getPlayers()) {
if ( p.getLobbyPlayer() != humanLobbyPlayer)
continue;
localHuman = (HumanPlayer) p;
localHuman = p;
break;
}
if (null == localHuman)

View File

@@ -1,28 +0,0 @@
/*
* Forge: Play Magic: the Gathering.
* Copyright (C) 2011 Forge Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package forge.game.player;
import forge.game.GameState;
public class HumanPlayer extends Player {
private HumanPlayer(final LobbyPlayerHuman player, GameState game) {
super(player, game);
}
} // end HumanPlayer class

View File

@@ -53,7 +53,6 @@ import forge.card.trigger.TriggerType;
import forge.game.GameState;
import forge.game.PlanarDice;
import forge.game.player.HumanPlay;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.game.zone.PlayerZone;
import forge.game.zone.ZoneType;
@@ -288,7 +287,7 @@ public final class GuiDisplayUtil {
List<Card> humanDevExileSetup = new ArrayList<Card>();
List<Card> computerDevExileSetup = new ArrayList<Card>();
final HumanPlayer human = Singletons.getControl().getPlayer();
final Player human = Singletons.getControl().getPlayer();
final Player ai = human.getOpponents().get(0);
if (!tChangePlayer.trim().toLowerCase().equals("none")) {

View File

@@ -29,7 +29,6 @@ import forge.GameEntity;
import forge.ImageCache;
import forge.Singletons;
import forge.game.phase.PhaseType;
import forge.game.player.HumanPlayer;
import forge.game.player.LobbyPlayer;
import forge.game.player.Player;
import forge.gui.framework.EDocID;
@@ -79,7 +78,7 @@ public enum CMatchUI {
* @param numFieldPanels int
* @param numHandPanels int
*/
public void initMatch(final List<Player> players, HumanPlayer localPlayer) {
public void initMatch(final List<Player> players, Player localPlayer) {
// TODO fix for use with multiplayer
final String[] indices = Singletons.getModel().getPreferences().getPref(FPref.UI_AVATARS).split(",");

View File

@@ -39,7 +39,6 @@ import forge.control.input.Input;
import forge.control.input.InputPayManaBase;
import forge.game.GameState;
import forge.game.player.HumanPlay;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.game.zone.ZoneType;
import forge.gui.ForgeAction.MatchConstants;
@@ -55,7 +54,7 @@ public class CField implements ICDoc {
// The one who owns cards on this side of table
private final Player player;
// Tho one who looks at screen and 'performs actions'
private final HumanPlayer playerViewer;
private final Player playerViewer;
private final VField view;
private boolean initializedAlready = false;
@@ -129,7 +128,7 @@ public class CField implements ICDoc {
* @param playerViewer
*/
@SuppressWarnings("serial")
public CField(final Player p0, final VField v0, HumanPlayer playerViewer) {
public CField(final Player p0, final VField v0, Player playerViewer) {
this.player = p0;
this.playerViewer = playerViewer;
this.view = v0;

View File

@@ -42,7 +42,6 @@ import forge.card.MagicColor;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.mana.ManaPool;
import forge.game.phase.PhaseType;
import forge.game.player.HumanPlayer;
import forge.game.player.Player;
import forge.game.zone.ZoneType;
import forge.gui.framework.DragCell;
@@ -118,7 +117,7 @@ public class VField implements IVDoc<CField> {
* @param playerOnwer &emsp; {@link forge.game.player.Player}
* @param id0 &emsp; {@link forge.gui.framework.EDocID}
*/
public VField(final EDocID id0, final Player playerOnwer, HumanPlayer playerViewer) {
public VField(final EDocID id0, final Player playerOnwer, Player playerViewer) {
this.docID = id0;
id0.setDoc(this);