mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
a couple of fields moved to base class
This commit is contained in:
@@ -407,16 +407,6 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id.
|
||||
*
|
||||
* @param id0
|
||||
* the id to set
|
||||
*/
|
||||
public void setId(final int id0) {
|
||||
this.id = id0;
|
||||
}
|
||||
|
||||
private Ability triggeredSA;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@ import forge.card.mana.Mana;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.Target;
|
||||
import forge.control.input.Input;
|
||||
import forge.control.input.InputAutoPassPriority;
|
||||
import forge.deck.Deck;
|
||||
import forge.game.GameState;
|
||||
import forge.game.GameType;
|
||||
@@ -30,16 +31,19 @@ public abstract class PlayerController {
|
||||
protected final GameState game;
|
||||
|
||||
private PhaseType autoPassUntil = null;
|
||||
|
||||
public PlayerController(GameState game0) {
|
||||
private final Input autoPassPriorityInput;
|
||||
protected final Player player;
|
||||
|
||||
public PlayerController(GameState game0, Player p) {
|
||||
game = game0;
|
||||
|
||||
player = p;
|
||||
autoPassPriorityInput = new InputAutoPassPriority(getPlayer());
|
||||
}
|
||||
|
||||
public abstract Input getDefaultInput();
|
||||
public abstract Input getBlockInput();
|
||||
public abstract Input getCleanupInput();
|
||||
public abstract Input getAutoPassPriorityInput();
|
||||
public final Input getAutoPassPriorityInput() { return autoPassPriorityInput; }
|
||||
|
||||
public abstract boolean shouldAlwaysAcceptTrigger(Integer trigger);
|
||||
public abstract boolean shouldAlwaysDeclineTrigger(Integer trigger);
|
||||
@@ -93,7 +97,7 @@ public abstract class PlayerController {
|
||||
/**
|
||||
* @return the player
|
||||
*/
|
||||
protected abstract Player getPlayer();
|
||||
protected final Player getPlayer(){ return player; }
|
||||
|
||||
|
||||
public abstract Deck sideboard(final Deck deck, GameType gameType);
|
||||
|
||||
@@ -19,7 +19,6 @@ import forge.card.spellability.Spell;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.Target;
|
||||
import forge.control.input.Input;
|
||||
import forge.control.input.InputAutoPassPriority;
|
||||
import forge.deck.Deck;
|
||||
import forge.game.GameState;
|
||||
import forge.game.GameType;
|
||||
@@ -44,10 +43,9 @@ public class PlayerControllerAi extends PlayerController {
|
||||
private Input defaultInput;
|
||||
private Input blockInput;
|
||||
private Input cleanupInput;
|
||||
private Input autoPassPriorityInput;
|
||||
|
||||
|
||||
private final AiController brains;
|
||||
private final Player player;
|
||||
|
||||
|
||||
|
||||
public final Input getDefaultInput() {
|
||||
@@ -55,15 +53,13 @@ public class PlayerControllerAi extends PlayerController {
|
||||
}
|
||||
|
||||
public PlayerControllerAi(GameState game, Player p) {
|
||||
super(game);
|
||||
player = p;
|
||||
|
||||
super(game, p);
|
||||
|
||||
brains = new AiController(p, game);
|
||||
|
||||
defaultInput = new AiInputCommon(brains);
|
||||
blockInput = new AiInputBlock(getPlayer());
|
||||
cleanupInput = getDefaultInput();
|
||||
autoPassPriorityInput = new InputAutoPassPriority(getPlayer());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,10 +80,6 @@ public class PlayerControllerAi extends PlayerController {
|
||||
return blockInput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Input getAutoPassPriorityInput() {
|
||||
return autoPassPriorityInput;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cleanupInput
|
||||
@@ -139,11 +131,6 @@ public class PlayerControllerAi extends PlayerController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Deck sideboard(Deck deck, GameType gameType) {
|
||||
// AI does not know how to sideboard
|
||||
|
||||
@@ -19,7 +19,6 @@ import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.Target;
|
||||
import forge.card.spellability.TargetSelection;
|
||||
import forge.control.input.Input;
|
||||
import forge.control.input.InputAutoPassPriority;
|
||||
import forge.control.input.InputBlock;
|
||||
import forge.control.input.InputCleanup;
|
||||
import forge.control.input.InputPassPriority;
|
||||
@@ -50,21 +49,16 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
private final Input defaultInput;
|
||||
private final Input blockInput;
|
||||
private final Input cleanupInput;
|
||||
private final Input autoPassPriorityInput;
|
||||
private final Player player;
|
||||
|
||||
public final Input getDefaultInput() {
|
||||
return defaultInput;
|
||||
}
|
||||
|
||||
public PlayerControllerHuman(GameState game0, Player p) {
|
||||
super(game0);
|
||||
player = p;
|
||||
|
||||
super(game0, p);
|
||||
defaultInput = new InputPassPriority(player);
|
||||
blockInput = new InputBlock(getPlayer(), game0);
|
||||
cleanupInput = new InputCleanup(getPlayer());
|
||||
autoPassPriorityInput = new InputAutoPassPriority(getPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,11 +84,6 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
return blockInput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Input getAutoPassPriorityInput() {
|
||||
return autoPassPriorityInput;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cleanupInput
|
||||
*/
|
||||
@@ -138,14 +127,6 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
HumanPlay.playSaWithoutPayingManaCost(player, copySA);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the player
|
||||
*/
|
||||
@Override
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.game.player.PlayerController#sideboard(forge.deck.Deck)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user