src/main/java/ru/alphatech/icfpc/policy/AttackPolicy.java
changeset 71 497185ce6691
parent 61 5587303ff52c
equal deleted inserted replaced
70:99a7f4b52678 71:497185ce6691
     1 package ru.alphatech.icfpc.policy;
       
     2 
       
     3 import java.util.ArrayList;
       
     4 
       
     5 import ru.alphatech.icfpc.cards.Attack;
       
     6 import ru.alphatech.icfpc.game.AbstractPolicy;
       
     7 import ru.alphatech.icfpc.game.Batch;
       
     8 import ru.alphatech.icfpc.game.Run;
       
     9 import ru.alphatech.icfpc.game.Slot;
       
    10 
       
    11 public class AttackPolicy extends AbstractPolicy {
       
    12 
       
    13 	private int donorSlotIndex   = -1;
       
    14 	private int targetSlotIndex  = -1;
       
    15 	private int pointsSlotIndex  = -1;
       
    16 	private int processingSlotIndex = -1;
       
    17 	
       
    18 	public AttackPolicy(int processingSlot, int donor, int target, int points) {
       
    19 		this.donorSlotIndex  = donor;
       
    20 		this.targetSlotIndex = target;
       
    21 		this.pointsSlotIndex = points;
       
    22 		this.processingSlotIndex = processingSlot;
       
    23 	}
       
    24 	
       
    25 	@Override
       
    26 	public ArrayList<Batch> getBatches() {
       
    27 		ArrayList<Batch> retArray = new ArrayList<Batch>();
       
    28 		
       
    29 		Slot processingSlot = Run.getProponent().getSlot(processingSlotIndex);
       
    30 		
       
    31 		numberIntoSlotField(Run.getRegisterByIndex(0), donorSlotIndex);
       
    32 		numberIntoSlotField(Run.getRegisterByIndex(1), targetSlotIndex);
       
    33 		numberIntoSlotField(Run.getRegisterByIndex(2), pointsSlotIndex);
       
    34 		
       
    35 		retArray.addAll(BcombineForFunctWith3ParamsInRegister(new Attack(), processingSlot));
       
    36 		
       
    37 		return retArray;
       
    38 	}
       
    39 	
       
    40 
       
    41 
       
    42 }