package ru.alphatech.icfpc.policy;

import java.util.ArrayList;

import ru.alphatech.icfpc.cards.Attack;
import ru.alphatech.icfpc.game.AbstractPolicy;
import ru.alphatech.icfpc.game.Batch;
import ru.alphatech.icfpc.game.Run;
import ru.alphatech.icfpc.game.Slot;

public class AttackPolicy extends AbstractPolicy {

	private int donorSlotIndex   = -1;
	private int targetSlotIndex  = -1;
	private int pointsSlotIndex  = -1;
	private int processingSlotIndex = -1;
	
	public AttackPolicy(int processingSlot, int donor, int target, int points) {
		this.donorSlotIndex  = donor;
		this.targetSlotIndex = target;
		this.pointsSlotIndex = points;
		this.processingSlotIndex = processingSlot;
	}
	
	@Override
	public ArrayList<Batch> getBatches() {
		ArrayList<Batch> retArray = new ArrayList<Batch>();
		
		Slot processingSlot = Run.getProponent().getSlot(processingSlotIndex);
		
		numberIntoSlotField(Run.getRegisterByIndex(0), donorSlotIndex);
		numberIntoSlotField(Run.getRegisterByIndex(1), targetSlotIndex);
		numberIntoSlotField(Run.getRegisterByIndex(2), pointsSlotIndex);
		
		retArray.addAll(BcombineForFunctWith3ParamsInRegister(new Attack(), processingSlot));
		
		return retArray;
	}
	


}
