use of mage.abilities.ActivatedAbility in project mage by magefree.
the class MCTSPlayer method getPlayableOptions.
public List<Ability> getPlayableOptions(Game game) {
List<Ability> all = new ArrayList<>();
List<ActivatedAbility> playables = getPlayableAbilities(game);
for (ActivatedAbility 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;
}
Aggregations