src/main/java/ru/alphatech/icfpc/game/strategy/HelpStrategy.java
author Azamat S. Kalimoulline <turtle@bazon.ru>
Tue, 21 Jun 2011 11:55:31 +0400
changeset 140 9ddaa68cccae
parent 138 fd3b663230ed
child 141 9d120210c248
permissions -rw-r--r--
Cards bugs revealed.
akhmetovlz@138
     1
package ru.alphatech.icfpc.game.strategy;
akhmetovlz@138
     2
akhmetovlz@138
     3
import java.util.LinkedList;
akhmetovlz@138
     4
akhmetovlz@138
     5
import ru.alphatech.icfpc.cards.I;
akhmetovlz@138
     6
import ru.alphatech.icfpc.game.Batch;
akhmetovlz@138
     7
import ru.alphatech.icfpc.game.ICFPCException;
akhmetovlz@138
     8
import ru.alphatech.icfpc.game.Player;
akhmetovlz@138
     9
import ru.alphatech.icfpc.game.Run;
akhmetovlz@138
    10
import ru.alphatech.icfpc.game.Batch.OperationType;
akhmetovlz@138
    11
import ru.alphatech.icfpc.policy.AttackHelpPolicy;
akhmetovlz@138
    12
import ru.alphatech.icfpc.policy.AttackHelpPolicy.TYPE;
akhmetovlz@138
    13
akhmetovlz@138
    14
public class HelpStrategy implements IStrategy {
akhmetovlz@138
    15
akhmetovlz@138
    16
	LinkedList<Batch> batches = new LinkedList<Batch>();
akhmetovlz@138
    17
	
akhmetovlz@138
    18
	public HelpStrategy() {
akhmetovlz@138
    19
	
turtle@140
    20
		batches.addAll(new AttackHelpPolicy(TYPE.HELP, 8, 0, 1, 16).getBatches());
akhmetovlz@138
    21
		
akhmetovlz@138
    22
	}
akhmetovlz@138
    23
	
akhmetovlz@138
    24
	boolean exit = false;
akhmetovlz@138
    25
	
akhmetovlz@138
    26
	@Override
akhmetovlz@138
    27
	public Batch move(Player proponent, Player opponent) {
akhmetovlz@138
    28
		Batch batch = batches.poll();
akhmetovlz@138
    29
		if(batch != null)
akhmetovlz@138
    30
			return batch;
akhmetovlz@138
    31
		
akhmetovlz@138
    32
		if(exit)
akhmetovlz@138
    33
			throw new ICFPCException();
akhmetovlz@138
    34
		
akhmetovlz@138
    35
		return new Batch(OperationType.CARD_TO_SLOT, new I(), Run.getProponent().getSlot(6));
akhmetovlz@138
    36
	}
akhmetovlz@138
    37
akhmetovlz@138
    38
}