1.1 --- a/src/main/java/ru/alphatech/icfpc/game/AbstractPolicy.java Sun Jun 19 16:52:01 2011 +0400
1.2 +++ b/src/main/java/ru/alphatech/icfpc/game/AbstractPolicy.java Sun Jun 19 16:52:20 2011 +0400
1.3 @@ -91,63 +91,5 @@
1.4 return retArray;
1.5 }
1.6
1.7 - protected ArrayList<Batch> BcombineForFunctWith3ParamsInRegister(ICard function, Slot processingSlot){
1.8 - ArrayList<Batch> retArray = new ArrayList<Batch>();
1.9 -
1.10 - if(!(function instanceof Attack || function instanceof Help)){
1.11 - throw new ICFPCException();
1.12 - }
1.13 -
1.14 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new Put(), processingSlot));
1.15 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, function, processingSlot));
1.16 -
1.17 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.18 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.19 -
1.20 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Get(), processingSlot));
1.21 -
1.22 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.23 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.24 -
1.25 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Zero(), processingSlot));
1.26 -
1.27 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.28 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.29 -
1.30 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Get(), processingSlot));
1.31 -
1.32 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.33 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.34 -
1.35 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Succ(), processingSlot));
1.36 -
1.37 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.38 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.39 -
1.40 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Zero(), processingSlot));
1.41 -
1.42 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.43 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.44 -
1.45 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Get(), processingSlot));
1.46 -
1.47 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.48 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.49 -
1.50 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Succ(), processingSlot));
1.51 -
1.52 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.53 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.54 -
1.55 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Succ(), processingSlot));
1.56 -
1.57 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new K(), processingSlot));
1.58 - retArray.add(new Batch(OperationType.CARD_TO_SLOT, new S(), processingSlot));
1.59 -
1.60 - retArray.add(new Batch(OperationType.SLOT_TO_CARD, new Zero(), processingSlot));
1.61 -
1.62 - return retArray;
1.63 - }
1.64 -
1.65 public abstract ArrayList<Batch> getBatches();
1.66 }
2.1 --- a/src/main/java/ru/alphatech/icfpc/policy/AttackHelpPolicy.java Sun Jun 19 16:52:01 2011 +0400
2.2 +++ b/src/main/java/ru/alphatech/icfpc/policy/AttackHelpPolicy.java Sun Jun 19 16:52:20 2011 +0400
2.3 @@ -67,7 +67,8 @@
2.4 return type == TYPE.ATTACK ? new Attack() : new Help();
2.5 }
2.6
2.7 - protected ArrayList<Batch> BcombineForFunctWith3ParamsInRegister(ICard function, Slot processingSlot){
2.8 + protected ArrayList<Batch> BcombineForFunctWith3ParamsInRegister(ICard function, Slot processingSlot)
2.9 + {
2.10 ArrayList<Batch> retArray = new ArrayList<Batch>();
2.11
2.12 if(!(function instanceof Attack || function instanceof Help)){
3.1 --- a/src/main/java/ru/alphatech/icfpc/policy/CompositionPolicy.java Sun Jun 19 16:52:01 2011 +0400
3.2 +++ b/src/main/java/ru/alphatech/icfpc/policy/CompositionPolicy.java Sun Jun 19 16:52:20 2011 +0400
3.3 @@ -5,19 +5,19 @@
3.4 import ru.alphatech.icfpc.game.AbstractPolicy;
3.5 import ru.alphatech.icfpc.game.Batch;
3.6
3.7 -public class CompositionPolicy extends AbstractPolicy{
3.8 +public abstract class CompositionPolicy extends AbstractPolicy{
3.9
3.10 protected ArrayList<AbstractPolicy> policies = new ArrayList<AbstractPolicy>();
3.11
3.12 - public void addPolicy(AbstractPolicy policy){
3.13 + protected void addPolicy(AbstractPolicy policy){
3.14 policies.add(policy);
3.15 }
3.16
3.17 - public void removePolicy(AbstractPolicy policy){
3.18 + protected void removePolicy(AbstractPolicy policy){
3.19 policies.remove(policy);
3.20 }
3.21
3.22 - public AbstractPolicy getPolicy(int index){
3.23 + protected AbstractPolicy getPolicy(int index){
3.24 return policies.get(index);
3.25 }
3.26