mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Add "ask simulated ai" dev option. (#2180)
* Add "ask simulated ai" dev option. Also moves the setup/dump game state options at the end of the list, as they're different from the other ones and shouldn't just be in the middle. Also makes the code a bit more concise for the different mouse listeners. * Fix comment location.
This commit is contained in:
@@ -28,31 +28,32 @@ public final class CDev implements ICDoc {
|
|||||||
this.view = new VDev(this);
|
this.view = new VDev(this);
|
||||||
addListener(view);
|
addListener(view);
|
||||||
|
|
||||||
view.getLblUnlimitedLands().addMouseListener(madUnlimited);
|
view.getLblUnlimitedLands().addMouseListener(onClick(this::togglePlayManyLandsPerTurn));
|
||||||
view.getLblViewAll().addMouseListener(madViewAll);
|
view.getLblViewAll().addMouseListener(onClick(this::toggleViewAllCards));
|
||||||
view.getLblGenerateMana().addMouseListener(madMana);
|
view.getLblGenerateMana().addMouseListener(onClick(this::generateMana));
|
||||||
view.getLblSetupGame().addMouseListener(madSetup);
|
view.getLblSetupGame().addMouseListener(onClick(this::setupGameState));
|
||||||
view.getLblDumpGame().addMouseListener(madDump);
|
view.getLblDumpGame().addMouseListener(onClick(this::dumpGameState));
|
||||||
view.getLblTutor().addMouseListener(madTutor);
|
view.getLblTutor().addMouseListener(onClick(this::tutorForCard));
|
||||||
view.getLblCardToHand().addMouseListener(madCardToHand);
|
view.getLblCardToHand().addMouseListener(onClick(this::addCardToHand));
|
||||||
view.getLblExileFromHand().addMouseListener(madExileFromHand);
|
view.getLblExileFromHand().addMouseListener(onClick(this::exileCardsFromHand));
|
||||||
view.getLblCardToBattlefield().addMouseListener(madCardToBattlefield);
|
view.getLblCardToBattlefield().addMouseListener(onClick(this::addCardToBattlefield));
|
||||||
view.getLblCardToLibrary().addMouseListener(madCardToLibrary);
|
view.getLblCardToLibrary().addMouseListener(onClick(this::addCardToLibrary));
|
||||||
view.getLblCardToGraveyard().addMouseListener(madCardToGraveyard);
|
view.getLblCardToGraveyard().addMouseListener(onClick(this::addCardToGraveyard));
|
||||||
view.getLblCardToExile().addMouseListener(madCardToExile);
|
view.getLblCardToExile().addMouseListener(onClick(this::addCardToExile));
|
||||||
view.getLblCastSpell().addMouseListener(madCastASpell);
|
view.getLblCastSpell().addMouseListener(onClick(this::castASpell));
|
||||||
view.getLblRepeatAddCard().addMouseListener(madRepeatAddCard);
|
view.getLblRepeatAddCard().addMouseListener(onClick(this::repeatAddCard));
|
||||||
view.getLblAddCounterPermanent().addMouseListener(madAddCounter);
|
view.getLblAddCounterPermanent().addMouseListener(onClick(this::addCounterToPermanent));
|
||||||
view.getLblSubCounterPermanent().addMouseListener(madSubCounter);
|
view.getLblSubCounterPermanent().addMouseListener(onClick(this::removeCountersFromPermanent));
|
||||||
view.getLblTapPermanent().addMouseListener(madTap);
|
view.getLblTapPermanent().addMouseListener(onClick(this::tapPermanent));
|
||||||
view.getLblUntapPermanent().addMouseListener(madUntap);
|
view.getLblUntapPermanent().addMouseListener(onClick(this::untapPermanent));
|
||||||
view.getLblSetLife().addMouseListener(madLife);
|
view.getLblSetLife().addMouseListener(onClick(this::setPlayerLife));
|
||||||
view.getLblWinGame().addMouseListener(madWinGame);
|
view.getLblWinGame().addMouseListener(onClick(this::winGame));
|
||||||
view.getLblExileFromPlay().addMouseListener(madExileFromPlay);
|
view.getLblExileFromPlay().addMouseListener(onClick(this::exileCardsFromPlay));
|
||||||
view.getLblRemoveFromGame().addMouseListener(madRemoveFromGame);
|
view.getLblRemoveFromGame().addMouseListener(onClick(this::removeCardsFromGame));
|
||||||
view.getLblRiggedRoll().addMouseListener(madRiggedRoll);
|
view.getLblRiggedRoll().addMouseListener(onClick(this::riggedPlanerRoll));
|
||||||
view.getLblWalkTo().addMouseListener(madWalkToPlane);
|
view.getLblWalkTo().addMouseListener(onClick(this::planeswalkTo));
|
||||||
view.getLblAskAI().addMouseListener(madAskAI);
|
view.getLblAskAI().addMouseListener(onClick(this::askAI));
|
||||||
|
view.getLblAskSimulationAI().addMouseListener(onClick(this::askSimulationAI));
|
||||||
}
|
}
|
||||||
public IGameController getController() {
|
public IGameController getController() {
|
||||||
return matchUI.getGameController();
|
return matchUI.getGameController();
|
||||||
@@ -66,258 +67,99 @@ public final class CDev implements ICDoc {
|
|||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madUnlimited = new MouseAdapter() {
|
private MouseListener onClick(Runnable r) {
|
||||||
@Override
|
return new MouseAdapter() {
|
||||||
public void mousePressed(final MouseEvent e) {
|
@Override
|
||||||
togglePlayManyLandsPerTurn();
|
public void mousePressed(final MouseEvent e) {
|
||||||
}
|
r.run();
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public void togglePlayManyLandsPerTurn() {
|
public void togglePlayManyLandsPerTurn() {
|
||||||
final boolean newValue = !view.getLblUnlimitedLands().getToggled();
|
final boolean newValue = !view.getLblUnlimitedLands().getToggled();
|
||||||
getController().cheat().setCanPlayUnlimitedLands(newValue);
|
getController().cheat().setCanPlayUnlimitedLands(newValue);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madViewAll = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
toggleViewAllCards();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void toggleViewAllCards() {
|
public void toggleViewAllCards() {
|
||||||
final boolean newValue = !view.getLblViewAll().getToggled();
|
final boolean newValue = !view.getLblViewAll().getToggled();
|
||||||
getController().cheat().setViewAllCards(newValue);
|
getController().cheat().setViewAllCards(newValue);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madMana = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
generateMana();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void generateMana() {
|
public void generateMana() {
|
||||||
getController().cheat().generateMana();
|
getController().cheat().generateMana();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madSetup = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
setupGameState();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void setupGameState() {
|
public void setupGameState() {
|
||||||
getController().cheat().setupGameState();
|
getController().cheat().setupGameState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madDump = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
dumpGameState();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void dumpGameState() {
|
public void dumpGameState() {
|
||||||
getController().cheat().dumpGameState();
|
getController().cheat().dumpGameState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madTutor = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
tutorForCard();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void tutorForCard() {
|
public void tutorForCard() {
|
||||||
getController().cheat().tutorForCard();
|
getController().cheat().tutorForCard();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madCardToHand = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
addCardToHand();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void addCardToHand() {
|
public void addCardToHand() {
|
||||||
getController().cheat().addCardToHand();
|
getController().cheat().addCardToHand();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madCardToLibrary = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
addCardToLibrary();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void addCardToLibrary() {
|
public void addCardToLibrary() {
|
||||||
getController().cheat().addCardToLibrary();
|
getController().cheat().addCardToLibrary();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madCardToGraveyard = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
addCardToGraveyard();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void addCardToGraveyard() {
|
public void addCardToGraveyard() {
|
||||||
getController().cheat().addCardToGraveyard();
|
getController().cheat().addCardToGraveyard();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madCardToExile = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
addCardToExile();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void addCardToExile() {
|
public void addCardToExile() {
|
||||||
getController().cheat().addCardToExile();
|
getController().cheat().addCardToExile();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madCastASpell = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
castASpell();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void castASpell() {
|
public void castASpell() {
|
||||||
getController().cheat().castASpell();
|
getController().cheat().castASpell();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madRepeatAddCard = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
repeatAddCard();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void repeatAddCard() {
|
public void repeatAddCard() {
|
||||||
getController().cheat().repeatLastAddition();
|
getController().cheat().repeatLastAddition();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madExileFromHand = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
exileCardsFromHand();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void exileCardsFromHand() {
|
public void exileCardsFromHand() {
|
||||||
getController().cheat().exileCardsFromHand();
|
getController().cheat().exileCardsFromHand();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madAddCounter = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
addCounterToPermanent();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void addCounterToPermanent() {
|
public void addCounterToPermanent() {
|
||||||
getController().cheat().addCountersToPermanent();
|
getController().cheat().addCountersToPermanent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madSubCounter = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
removeCountersFromPermanent();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void removeCountersFromPermanent() {
|
public void removeCountersFromPermanent() {
|
||||||
getController().cheat().removeCountersFromPermanent();
|
getController().cheat().removeCountersFromPermanent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madTap = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
tapPermanent();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void tapPermanent() {
|
public void tapPermanent() {
|
||||||
getController().cheat().tapPermanents();
|
getController().cheat().tapPermanents();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madUntap = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
untapPermanent();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void untapPermanent() {
|
public void untapPermanent() {
|
||||||
getController().cheat().untapPermanents();
|
getController().cheat().untapPermanents();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madLife = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
setPlayerLife();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void setPlayerLife() {
|
public void setPlayerLife() {
|
||||||
getController().cheat().setPlayerLife();
|
getController().cheat().setPlayerLife();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madWinGame = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
winGame();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void winGame() {
|
public void winGame() {
|
||||||
getController().cheat().winGame();
|
getController().cheat().winGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madCardToBattlefield = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
addCardToBattlefield();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void addCardToBattlefield() {
|
public void addCardToBattlefield() {
|
||||||
getController().cheat().addCardToBattlefield();
|
getController().cheat().addCardToBattlefield();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madExileFromPlay = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
exileCardsFromPlay();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void exileCardsFromPlay() {
|
public void exileCardsFromPlay() {
|
||||||
getController().cheat().exileCardsFromBattlefield();
|
getController().cheat().exileCardsFromBattlefield();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madRemoveFromGame = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
removeCardsFromGame();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void removeCardsFromGame() {
|
public void removeCardsFromGame() {
|
||||||
getController().cheat().removeCardsFromGame();
|
getController().cheat().removeCardsFromGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madRiggedRoll = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
riggedPlanerRoll();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void riggedPlanerRoll() {
|
public void riggedPlanerRoll() {
|
||||||
getController().cheat().riggedPlanarRoll();
|
getController().cheat().riggedPlanarRoll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madWalkToPlane = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
planeswalkTo();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void planeswalkTo() {
|
public void planeswalkTo() {
|
||||||
getController().cheat().planeswalkTo();
|
getController().cheat().planeswalkTo();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final MouseListener madAskAI = new MouseAdapter() {
|
|
||||||
@Override
|
|
||||||
public void mousePressed(final MouseEvent e) {
|
|
||||||
askAI();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
public void askAI() {
|
public void askAI() {
|
||||||
getController().cheat().askAI();
|
getController().cheat().askAI(false);
|
||||||
|
}
|
||||||
|
public void askSimulationAI() {
|
||||||
|
getController().cheat().askAI(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//========== End mouse listener inits
|
//========== End mouse listener inits
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public class VDev implements IVDoc<CDev>, IDevListener {
|
|||||||
private final DevLabel lblWalkTo = new DevLabel(Localizer.getInstance().getMessage("lblWalkTo"));
|
private final DevLabel lblWalkTo = new DevLabel(Localizer.getInstance().getMessage("lblWalkTo"));
|
||||||
|
|
||||||
private final DevLabel lblAskAI = new DevLabel(Localizer.getInstance().getMessage("lblAskAI"));
|
private final DevLabel lblAskAI = new DevLabel(Localizer.getInstance().getMessage("lblAskAI"));
|
||||||
|
private final DevLabel lblAskSimulationAI = new DevLabel(Localizer.getInstance().getMessage("lblAskSimulationAI"));
|
||||||
|
|
||||||
|
|
||||||
private final CDev controller;
|
private final CDev controller;
|
||||||
@@ -91,7 +92,6 @@ public class VDev implements IVDoc<CDev>, IDevListener {
|
|||||||
public VDev(final CDev controller) {
|
public VDev(final CDev controller) {
|
||||||
this.controller = controller;
|
this.controller = controller;
|
||||||
|
|
||||||
final String constraints = "w 95%!, gap 0 0 4px 0";
|
|
||||||
final String halfConstraints = "w 47%!, gap 0 0 4px 0";
|
final String halfConstraints = "w 47%!, gap 0 0 4px 0";
|
||||||
final String halfConstraintsLeft = halfConstraints + ", split 2";
|
final String halfConstraintsLeft = halfConstraints + ", split 2";
|
||||||
viewport.setOpaque(false);
|
viewport.setOpaque(false);
|
||||||
@@ -113,13 +113,14 @@ public class VDev implements IVDoc<CDev>, IDevListener {
|
|||||||
viewport.add(this.lblWinGame, halfConstraints);
|
viewport.add(this.lblWinGame, halfConstraints);
|
||||||
viewport.add(this.lblAddCounterPermanent, halfConstraintsLeft);
|
viewport.add(this.lblAddCounterPermanent, halfConstraintsLeft);
|
||||||
viewport.add(this.lblSubCounterPermanent, halfConstraints);
|
viewport.add(this.lblSubCounterPermanent, halfConstraints);
|
||||||
viewport.add(this.lblSetupGame, halfConstraintsLeft);
|
|
||||||
viewport.add(this.lblDumpGame, halfConstraints);
|
|
||||||
viewport.add(this.lblTapPermanent, halfConstraintsLeft);
|
viewport.add(this.lblTapPermanent, halfConstraintsLeft);
|
||||||
viewport.add(this.lblUntapPermanent, halfConstraints);
|
viewport.add(this.lblUntapPermanent, halfConstraints);
|
||||||
viewport.add(this.lblRiggedRoll, halfConstraintsLeft);
|
viewport.add(this.lblRiggedRoll, halfConstraintsLeft);
|
||||||
viewport.add(this.lblWalkTo, halfConstraints);
|
viewport.add(this.lblWalkTo, halfConstraints);
|
||||||
viewport.add(this.lblAskAI, halfConstraintsLeft);
|
viewport.add(this.lblAskAI, halfConstraintsLeft);
|
||||||
|
viewport.add(this.lblAskSimulationAI, halfConstraintsLeft);
|
||||||
|
viewport.add(this.lblSetupGame, halfConstraintsLeft);
|
||||||
|
viewport.add(this.lblDumpGame, halfConstraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
//========= Overridden methods
|
//========= Overridden methods
|
||||||
@@ -302,20 +303,23 @@ public class VDev implements IVDoc<CDev>, IDevListener {
|
|||||||
return this.lblAskAI;
|
return this.lblAskAI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DevLabel getLblAskSimulationAI() {
|
||||||
|
return this.lblAskSimulationAI;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Labels that act as buttons which control dev mode functions. Labels are
|
* Labels that act as buttons which control dev mode functions. Labels are
|
||||||
* used to support multiline text.
|
* used to support multiline text.
|
||||||
*/
|
*/
|
||||||
public class DevLabel extends SkinnedLabel {
|
public static class DevLabel extends SkinnedLabel {
|
||||||
private static final long serialVersionUID = 7917311680519060700L;
|
private static final long serialVersionUID = 7917311680519060700L;
|
||||||
|
|
||||||
private FSkin.SkinColor defaultBG;
|
private FSkin.SkinColor defaultBG;
|
||||||
private final FSkin.SkinColor hoverBG = FSkin.getColor(FSkin.Colors.CLR_HOVER);
|
private final FSkin.SkinColor hoverBG = FSkin.getColor(FSkin.Colors.CLR_HOVER);
|
||||||
private final FSkin.SkinColor pressedBG = FSkin.getColor(FSkin.Colors.CLR_INACTIVE);
|
private final FSkin.SkinColor pressedBG = FSkin.getColor(FSkin.Colors.CLR_INACTIVE);
|
||||||
private boolean toggled;
|
private boolean toggled;
|
||||||
private int w, h; // Width, height, radius, insets (for paintComponent)
|
|
||||||
|
|
||||||
private final int r, i;
|
private final int r, i; // Radius, insets (for paintComponent)
|
||||||
|
|
||||||
public DevLabel(final String text0) {
|
public DevLabel(final String text0) {
|
||||||
super();
|
super();
|
||||||
@@ -380,10 +384,10 @@ public class VDev implements IVDoc<CDev>, IDevListener {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void paintComponent(final Graphics g) {
|
protected void paintComponent(final Graphics g) {
|
||||||
this.w = this.getWidth();
|
int w = this.getWidth();
|
||||||
this.h = this.getHeight();
|
int h = this.getHeight();
|
||||||
g.setColor(this.getBackground());
|
g.setColor(this.getBackground());
|
||||||
g.fillRoundRect(this.i, this.i, this.w - (2 * this.i), this.h - this.i, this.r, this.r);
|
g.fillRoundRect(this.i, this.i, w - (2 * this.i), h - this.i, this.r, this.r);
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2100,6 +2100,7 @@ lblRemoveFromGame=Remove Card from Game
|
|||||||
lblRiggedRoll=Rigged Planar Roll
|
lblRiggedRoll=Rigged Planar Roll
|
||||||
lblWalkTo=Planeswalk to
|
lblWalkTo=Planeswalk to
|
||||||
lblAskAI=Ask AI for suggestion
|
lblAskAI=Ask AI for suggestion
|
||||||
|
lblAskSimulationAI=Ask Simulation AI for suggestion
|
||||||
#PhaseType.java
|
#PhaseType.java
|
||||||
lblUntapStep=Untap step
|
lblUntapStep=Untap step
|
||||||
lblUpkeepStep=Upkeep step
|
lblUpkeepStep=Upkeep step
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public interface IDevModeCheats {
|
|||||||
|
|
||||||
void planeswalkTo();
|
void planeswalkTo();
|
||||||
|
|
||||||
void askAI();
|
void askAI(boolean useSimulation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link IDevModeCheats} that disallows cheating by
|
* Implementation of {@link IDevModeCheats} that disallows cheating by
|
||||||
@@ -144,7 +144,7 @@ public interface IDevModeCheats {
|
|||||||
public void removeCardsFromGame() {
|
public void removeCardsFromGame() {
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void askAI() {
|
public void askAI(boolean useSimulation) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3042,8 +3042,9 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void askAI() {
|
public void askAI(boolean useSimulation) {
|
||||||
PlayerControllerAi ai = new PlayerControllerAi(player.getGame(), player, player.getOriginalLobbyPlayer());
|
PlayerControllerAi ai = new PlayerControllerAi(player.getGame(), player, player.getOriginalLobbyPlayer());
|
||||||
|
ai.setUseSimulation(useSimulation);
|
||||||
player.runWithController(() -> {
|
player.runWithController(() -> {
|
||||||
List<SpellAbility> sas = ai.chooseSpellAbilityToPlay();
|
List<SpellAbility> sas = ai.chooseSpellAbilityToPlay();
|
||||||
SpellAbility chosen = sas == null ? null : sas.get(0);
|
SpellAbility chosen = sas == null ? null : sas.get(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user