src/main/java/ru/alphatech/icfpc/game/strategy/SimplyStrategy.java
changeset 118 8fca5b204fb3
parent 111 0b8b3ec13a82
equal deleted inserted replaced
117:b7782c34c147 118:8fca5b204fb3
     1 package ru.alphatech.icfpc.game.strategy;
     1 package ru.alphatech.icfpc.game.strategy;
     2 
       
     3 import java.util.LinkedList;
       
     4 
     2 
     5 import ru.alphatech.icfpc.cards.I;
     3 import ru.alphatech.icfpc.cards.I;
     6 import ru.alphatech.icfpc.game.Batch;
     4 import ru.alphatech.icfpc.game.Batch;
     7 import ru.alphatech.icfpc.game.Player;
     5 import ru.alphatech.icfpc.game.Player;
     8 import ru.alphatech.icfpc.game.Batch.OperationType;
     6 import ru.alphatech.icfpc.game.Batch.OperationType;
     9 import ru.alphatech.icfpc.policy.AttackHelpPolicy;
       
    10 import ru.alphatech.icfpc.policy.CallExpressionPolicy;
       
    11 import ru.alphatech.icfpc.policy.AttackHelpPolicy.TYPE;
       
    12 
     7 
    13 /**
     8 /**
    14  * @author indvdum
     9  * @author indvdum
    15  * 19.06.2011 13:36:26
    10  * 19.06.2011 13:36:26
    16  *
    11  *
    17  */
    12  */
    18 public class SimplyStrategy implements IStrategy {
    13 public class SimplyStrategy implements IStrategy {
    19 
    14 
    20 	LinkedList<Batch> batches = new LinkedList<Batch>();
       
    21 	
       
    22 	public SimplyStrategy() {
    15 	public SimplyStrategy() {
    23 		batches.addAll(new AttackHelpPolicy(TYPE.HELP, 10, 5, 5, 9999, false).getBatches());
       
    24 		for(int i=0; i<100; ++i){
       
    25 			batches.addAll(new CallExpressionPolicy(8, 10, 0, true).getBatches());
       
    26 		}
       
    27 	}
    16 	}
    28 	
    17 	
    29 	@Override
    18 	@Override
    30 	public Batch move(Player proponent, Player opponent) {
    19 	public Batch move(Player proponent, Player opponent) {
    31 		Batch batch = batches.poll();
    20 		return new Batch(OperationType.CARD_TO_SLOT, new I(), proponent.getSlot(0));
    32 		return batch != null ? batch : new Batch(OperationType.CARD_TO_SLOT, new I(), proponent.getSlot(0));
       
    33 	}
    21 	}
    34 
    22 
    35 }
    23 }