- Reimplemented the ordering of attackers in ComputerUtil_Block2.

This commit is contained in:
jendave
2011-08-06 20:40:26 +00:00
parent bb75f34e7e
commit 4fc3d95891

View File

@@ -49,6 +49,9 @@ public class ComputerUtil_Block2
ArrayList<Object> defenders = combat.getDefenders(); ArrayList<Object> defenders = combat.getDefenders();
//Begin with the attackers that pose the biggest thread
CardListUtil.sortAttack(attackerLists[0]);
// If I don't have any planeswalkers than sorting doesn't really matter // If I don't have any planeswalkers than sorting doesn't really matter
if (defenders.size() == 1) if (defenders.size() == 1)
return attackerLists[0]; return attackerLists[0];
@@ -59,6 +62,8 @@ public class ComputerUtil_Block2
// defend planeswalkers with more loyalty before planeswalkers with less loyalty // defend planeswalkers with more loyalty before planeswalkers with less loyalty
// if planeswalker will be too difficult to defend don't even bother // if planeswalker will be too difficult to defend don't even bother
for(int i = 1; i < attackerLists.length; i++){ for(int i = 1; i < attackerLists.length; i++){
//Begin with the attackers that pose the biggest thread
CardListUtil.sortAttack(attackerLists[i]);
for(Card c : attackerLists[i]) for(Card c : attackerLists[i])
sortedAttackers.add(c); sortedAttackers.add(c);
} }
@@ -136,10 +141,6 @@ public class ComputerUtil_Block2
if (blockersLeft.size() == 0) if (blockersLeft.size() == 0)
return combat; return combat;
/*
//Begin with the attackers that pose the biggest thread
CardListUtil.sortAttack(attackersLeft);*/
//Begin with the weakest blockers //Begin with the weakest blockers
CardListUtil.sortAttackLowFirst(blockersLeft); CardListUtil.sortAttackLowFirst(blockersLeft);