mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Deleted some unused functions.
This commit is contained in:
@@ -208,50 +208,6 @@ public class AIPlayer extends Player {
|
||||
AllZone.getComputerPlayer().discard(num, sa, false);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void handToLibrary(final int numToLibrary, final String libPosIn) {
|
||||
final String libPos = libPosIn;
|
||||
|
||||
for (int i = 0; i < numToLibrary; i++) {
|
||||
int position;
|
||||
if (libPos.equalsIgnoreCase("Top")) {
|
||||
position = 0;
|
||||
} else if (libPos.equalsIgnoreCase("Bottom")) {
|
||||
position = -1;
|
||||
} else {
|
||||
final Random r = MyRandom.getRandom();
|
||||
if (r.nextBoolean()) {
|
||||
position = 0;
|
||||
} else {
|
||||
position = -1;
|
||||
}
|
||||
}
|
||||
final CardList hand = AllZone.getComputerPlayer().getCardsIn(ZoneType.Hand);
|
||||
|
||||
CardList blIP = AllZone.getComputerPlayer().getCardsIn(ZoneType.Battlefield);
|
||||
|
||||
blIP = blIP.getType("Basic");
|
||||
if (blIP.size() > 5) {
|
||||
final CardList blIH = hand.getType("Basic");
|
||||
if (blIH.size() > 0) {
|
||||
final Card card = blIH.get(CardUtil.getRandomIndex(blIH));
|
||||
|
||||
Singletons.getModel().getGameAction().moveToLibrary(card, position);
|
||||
} else {
|
||||
CardListUtil.sortAttackLowFirst(hand);
|
||||
CardListUtil.sortNonFlyingFirst(hand);
|
||||
|
||||
Singletons.getModel().getGameAction().moveToLibrary(hand.get(0), position);
|
||||
}
|
||||
} else {
|
||||
CardListUtil.sortCMC(hand);
|
||||
|
||||
Singletons.getModel().getGameAction().moveToLibrary(hand.get(0), position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// /////////////////////////
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
||||
@@ -193,24 +193,6 @@ public class HumanPlayer extends Player {
|
||||
AllZone.getInputControl().setInput(PlayerUtil.inputChainsDiscard(), true);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void handToLibrary(final int numToLibrary, String libPos) {
|
||||
if (libPos.equals("Top") || libPos.equals("Bottom")) {
|
||||
libPos = libPos.toLowerCase();
|
||||
} else {
|
||||
String s = "card";
|
||||
if (numToLibrary > 1) {
|
||||
s += "s";
|
||||
}
|
||||
|
||||
final Object o = GuiUtils.chooseOne("Do you want to put the " + s
|
||||
+ " on the top or bottom of your library?", new Object[] { "top", "bottom" });
|
||||
libPos = o.toString();
|
||||
}
|
||||
AllZone.getInputControl().setInput(PlayerUtil.inputPutFromHandToLibrary(libPos, numToLibrary));
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected final void doScry(final CardList topN, final int n) {
|
||||
|
||||
@@ -1721,18 +1721,6 @@ public abstract class Player extends GameEntity {
|
||||
return milled;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* handToLibrary.
|
||||
* </p>
|
||||
*
|
||||
* @param numToLibrary
|
||||
* a int.
|
||||
* @param libPos
|
||||
* a {@link java.lang.String} object.
|
||||
*/
|
||||
public abstract void handToLibrary(final int numToLibrary, String libPos);
|
||||
|
||||
// //////////////////////////////
|
||||
/**
|
||||
* <p>
|
||||
@@ -2088,28 +2076,6 @@ public abstract class Player extends GameEntity {
|
||||
*/
|
||||
public abstract void sacrificePermanent(String prompt, CardList choices);
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* sacrificeCreature.
|
||||
* </p>
|
||||
*/
|
||||
public final void sacrificeCreature() {
|
||||
final CardList choices = AllZoneUtil.getCreaturesInPlay(this);
|
||||
this.sacrificePermanent("Select a creature to sacrifice.", choices);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* sacrificeCreature.
|
||||
* </p>
|
||||
*
|
||||
* @param choices
|
||||
* a {@link forge.CardList} object.
|
||||
*/
|
||||
public final void sacrificeCreature(final CardList choices) {
|
||||
this.sacrificePermanent("Select a creature to sacrifice.", choices);
|
||||
}
|
||||
|
||||
// Game win/loss
|
||||
|
||||
/**
|
||||
|
||||
@@ -313,58 +313,4 @@ public final class PlayerUtil {
|
||||
return target;
|
||||
} // input_sacrificePermanents()
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* input_putFromHandToLibrary.
|
||||
* </p>
|
||||
*
|
||||
* @param topOrBottom
|
||||
* a {@link java.lang.String} object.
|
||||
* @param num
|
||||
* a int.
|
||||
* @return a {@link forge.control.input.Input} object.
|
||||
* @since 1.0.15
|
||||
*/
|
||||
public static Input inputPutFromHandToLibrary(final String topOrBottom, final int num) {
|
||||
final Input target = new Input() {
|
||||
private static final long serialVersionUID = 5178077952030689103L;
|
||||
private int n = 0;
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
CMatchUI.SINGLETON_INSTANCE.showMessage("Select a card to put on the " + topOrBottom + " of your library.");
|
||||
ButtonUtil.disableAll();
|
||||
|
||||
if ((this.n == num) || (AllZone.getHumanPlayer().getZone(ZoneType.Hand).size() == 0)) {
|
||||
this.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectButtonCancel() {
|
||||
this.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectCard(final Card card, final PlayerZone zone) {
|
||||
if (zone.is(ZoneType.Hand)) {
|
||||
int position = 0;
|
||||
if (topOrBottom.equalsIgnoreCase("bottom")) {
|
||||
position = -1;
|
||||
}
|
||||
|
||||
Singletons.getModel().getGameAction().moveToLibrary(card, position);
|
||||
|
||||
this.n++;
|
||||
if (this.n == num) {
|
||||
this.stop();
|
||||
}
|
||||
|
||||
this.showMessage();
|
||||
}
|
||||
}
|
||||
};
|
||||
return target;
|
||||
}
|
||||
|
||||
} // end class PlayerUtil
|
||||
|
||||
Reference in New Issue
Block a user