if artificial choice is empty, getSimulationResultChoice returns null

master
melvin 2011-06-07 10:31:51 +08:00
parent 7b2606e6c9
commit 2323cdbedc
1 changed files with 5 additions and 1 deletions

View File

@ -80,8 +80,12 @@ public abstract class MagicChoice {
final MagicPlayer player,
final MagicSource source) {
final List<Object[]> choices = getArtificialChoiceResults(game, event, player, source);
if (choices.size() == 0) {
return null;
} else {
return choices.get(MagicRandom.nextInt(choices.size()));
}
}
/** Gets the choice results of the player. */
public abstract Object[] getPlayerChoiceResults(final GameController controller,final MagicGame game,final MagicPlayer player,final MagicSource source);