package ru.alphatech.icfpc.game.strategy;

import java.util.LinkedList;

import ru.alphatech.icfpc.cards.I;
import ru.alphatech.icfpc.game.Batch;
import ru.alphatech.icfpc.game.ICFPCException;
import ru.alphatech.icfpc.game.Player;
import ru.alphatech.icfpc.game.Run;
import ru.alphatech.icfpc.game.Batch.OperationType;
import ru.alphatech.icfpc.policy.AttackHelpPolicy;
import ru.alphatech.icfpc.policy.AttackHelpPolicy.TYPE;

public class HelpStrategy implements IStrategy {

	LinkedList<Batch> batches = new LinkedList<Batch>();
	
	public HelpStrategy() {
	
		batches.addAll(new AttackHelpPolicy(TYPE.HELP, 8, 0, 1, 16).getBatches());
		
	}
	
	boolean exit = false;
	
	@Override
	public Batch move(Player proponent, Player opponent) {
		Batch batch = batches.poll();
		if(batch != null)
			return batch;
		
		if(exit)
			throw new ICFPCException();
		
		exit = true;
		return new Batch(OperationType.CARD_TO_SLOT, new I(), Run.getProponent().getSlot(6));
	}

}
