added methods to query player if he wants to take turn first

It is used by new revision of GameNew that I don't commit yet because it contains other changes unsafe for todays release
This commit is contained in:
Maxmtg
2013-03-01 07:52:11 +00:00
parent 8d95358927
commit 92be09cf69
3 changed files with 15 additions and 1 deletions

View File

@@ -65,7 +65,7 @@ public abstract class PlayerController {
*/ */
public void passPriority() { public void passPriority() {
PhaseHandler handler = game.getPhaseHandler(); PhaseHandler handler = game.getPhaseHandler();
// may pass only priority is has
if ( handler.getPriorityPlayer() == getPlayer() ) if ( handler.getPriorityPlayer() == getPlayer() )
game.getPhaseHandler().passPriority(); game.getPhaseHandler().passPriority();
} }
@@ -95,5 +95,6 @@ public abstract class PlayerController {
public Card chooseSingleCardForEffect(List<Card> sourceList, SpellAbility sa, String title) { return chooseSingleCardForEffect(sourceList, sa, title, false); } public Card chooseSingleCardForEffect(List<Card> sourceList, SpellAbility sa, String title) { return chooseSingleCardForEffect(sourceList, sa, title, false); }
public abstract Card chooseSingleCardForEffect(List<Card> sourceList, SpellAbility sa, String title, boolean isOptional); public abstract Card chooseSingleCardForEffect(List<Card> sourceList, SpellAbility sa, String title, boolean isOptional);
public abstract boolean confirmAction(SpellAbility sa, String mode, String message); public abstract boolean confirmAction(SpellAbility sa, String mode, String message);
public abstract boolean getWillPlayOnFirstTurn(String message);
public abstract boolean confirmStaticApplication(Card hostCard, GameEntity affected, String logic, String message); public abstract boolean confirmStaticApplication(Card hostCard, GameEntity affected, String logic, String message);
} }

View File

@@ -198,6 +198,10 @@ public class PlayerControllerAi extends PlayerController {
return brains.confirmAction(sa, mode, message); return brains.confirmAction(sa, mode, message);
} }
@Override
public boolean getWillPlayOnFirstTurn(String message) {
return true; // AI is brave :)
}
@Override @Override
public boolean confirmStaticApplication(Card hostCard, GameEntity affected, String logic, String message) { public boolean confirmStaticApplication(Card hostCard, GameEntity affected, String logic, String message) {
return brains.confirmStaticApplication(hostCard, affected, logic, message); return brains.confirmStaticApplication(hostCard, affected, logic, message);

View File

@@ -250,5 +250,14 @@ public class PlayerControllerHuman extends PlayerController {
return GuiDialog.confirm(hostCard, message); return GuiDialog.confirm(hostCard, message);
} }
@Override
public boolean getWillPlayOnFirstTurn(String message) {
final String[] possibleValues = { "Play", "Draw" };
final Object playDraw = JOptionPane.showOptionDialog(null, message + "\n\nWould you like to play or draw?",
"Play or Draw?", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null,
possibleValues, possibleValues[0]);
return !playDraw.equals(1);
}
} }