use of mage.player.ai.simulators.CombatSimulator in project mage by magefree.
the class ComputerPlayer method addBlockSimulations.
protected void addBlockSimulations(List<Permanent> blockers, TreeNode<CombatSimulator> node, Game game) {
int numGroups = node.getData().groups.size();
Copier<CombatSimulator> copier = new Copier<>();
for (Permanent blocker : blockers) {
List<Permanent> subList = remove(blockers, blocker);
for (int i = 0; i < numGroups; i++) {
if (node.getData().groups.get(i).canBlock(blocker, game)) {
CombatSimulator combat = copier.copy(node.getData());
combat.groups.get(i).blockers.add(new CreatureSimulator(blocker));
TreeNode<CombatSimulator> child = new TreeNode<>(combat);
node.addChild(child);
addBlockSimulations(subList, child, game);
combat.simulate(game);
}
}
}
}
Aggregations