public List<Ability> getPlayableOptions(Game game) { List<Ability> all = new ArrayList<>(); List<Ability> playables = getPlayableAbilities(game); for (Ability ability: playables) { List<Ability> options = game.getPlayer(playerId).getPlayableOptions(ability, game); if (options.isEmpty()) { if (!ability.getManaCosts().getVariableCosts().isEmpty()) { simulateVariableCosts(ability, all, game); } else { all.add(ability); } } else { for (Ability option: options) { if (!ability.getManaCosts().getVariableCosts().isEmpty()) { simulateVariableCosts(option, all, game); } else { all.add(option); } } } } return all; }
protected void simulateOptions(Game game) { List<Ability> playables = game.getPlayer(playerId).getPlayable(game, isSimulatedPlayer); playables = filterAbilities(game, playables, suggested); for (Ability ability : playables) { if (ability.getAbilityType() == AbilityType.MANA) { continue; } List<Ability> options = game.getPlayer(playerId).getPlayableOptions(ability, game); options = filterOptions(game, options, ability, suggested); options = optimizeOptions(game, options, ability); if (options.isEmpty()) { allActions.add(ability); } else { for (Ability option : options) { allActions.add(option); } } } }
List<Ability> playables = game.getPlayer(playerId).getPlayable(game, isSimulatedPlayer); for (Ability ability: playables) { List<Ability> options = game.getPlayer(playerId).getPlayableOptions(ability, game); if (options.isEmpty()) { if (!ability.getManaCosts().getVariableCosts().isEmpty()) {