src/main/java/ru/alphatech/icfpc/policy/AttackPolicy.java
changeset 65 2c8b98d4efb8
parent 61 5587303ff52c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/main/java/ru/alphatech/icfpc/policy/AttackPolicy.java	Sun Jun 19 14:30:33 2011 +0400
     1.3 @@ -0,0 +1,42 @@
     1.4 +package ru.alphatech.icfpc.policy;
     1.5 +
     1.6 +import java.util.ArrayList;
     1.7 +
     1.8 +import ru.alphatech.icfpc.cards.Attack;
     1.9 +import ru.alphatech.icfpc.game.AbstractPolicy;
    1.10 +import ru.alphatech.icfpc.game.Batch;
    1.11 +import ru.alphatech.icfpc.game.Run;
    1.12 +import ru.alphatech.icfpc.game.Slot;
    1.13 +
    1.14 +public class AttackPolicy extends AbstractPolicy {
    1.15 +
    1.16 +	private int donorSlotIndex   = -1;
    1.17 +	private int targetSlotIndex  = -1;
    1.18 +	private int pointsSlotIndex  = -1;
    1.19 +	private int processingSlotIndex = -1;
    1.20 +	
    1.21 +	public AttackPolicy(int processingSlot, int donor, int target, int points) {
    1.22 +		this.donorSlotIndex  = donor;
    1.23 +		this.targetSlotIndex = target;
    1.24 +		this.pointsSlotIndex = points;
    1.25 +		this.processingSlotIndex = processingSlot;
    1.26 +	}
    1.27 +	
    1.28 +	@Override
    1.29 +	public ArrayList<Batch> getBatches() {
    1.30 +		ArrayList<Batch> retArray = new ArrayList<Batch>();
    1.31 +		
    1.32 +		Slot processingSlot = Run.getProponent().getSlot(processingSlotIndex);
    1.33 +		
    1.34 +		numberIntoSlotField(Run.getRegisterByIndex(0), donorSlotIndex);
    1.35 +		numberIntoSlotField(Run.getRegisterByIndex(1), targetSlotIndex);
    1.36 +		numberIntoSlotField(Run.getRegisterByIndex(2), pointsSlotIndex);
    1.37 +		
    1.38 +		retArray.addAll(BcombineForFunctWith3ParamsInRegister(new Attack(), processingSlot));
    1.39 +		
    1.40 +		return retArray;
    1.41 +	}
    1.42 +	
    1.43 +
    1.44 +
    1.45 +}