| author | akhmetovlz |
| Sun, 19 Jun 2011 14:35:19 +0400 | |
| changeset 67 | e2df2fbc6e8e |
| parent 61 | 5587303ff52c |
| permissions | -rw-r--r-- |
| akhmetovlz@61 | 1 |
package ru.alphatech.icfpc.policy; |
| akhmetovlz@61 | 2 |
|
| akhmetovlz@61 | 3 |
import java.util.ArrayList; |
| akhmetovlz@61 | 4 |
|
| akhmetovlz@61 | 5 |
import ru.alphatech.icfpc.cards.Attack; |
| akhmetovlz@61 | 6 |
import ru.alphatech.icfpc.game.AbstractPolicy; |
| akhmetovlz@61 | 7 |
import ru.alphatech.icfpc.game.Batch; |
| akhmetovlz@61 | 8 |
import ru.alphatech.icfpc.game.Run; |
| akhmetovlz@61 | 9 |
import ru.alphatech.icfpc.game.Slot; |
| akhmetovlz@61 | 10 |
|
| akhmetovlz@61 | 11 |
public class AttackPolicy extends AbstractPolicy {
|
| akhmetovlz@61 | 12 |
|
| akhmetovlz@61 | 13 |
private int donorSlotIndex = -1; |
| akhmetovlz@61 | 14 |
private int targetSlotIndex = -1; |
| akhmetovlz@61 | 15 |
private int pointsSlotIndex = -1; |
| akhmetovlz@61 | 16 |
private int processingSlotIndex = -1; |
| akhmetovlz@61 | 17 |
|
| akhmetovlz@61 | 18 |
public AttackPolicy(int processingSlot, int donor, int target, int points) {
|
| akhmetovlz@61 | 19 |
this.donorSlotIndex = donor; |
| akhmetovlz@61 | 20 |
this.targetSlotIndex = target; |
| akhmetovlz@61 | 21 |
this.pointsSlotIndex = points; |
| akhmetovlz@61 | 22 |
this.processingSlotIndex = processingSlot; |
| akhmetovlz@61 | 23 |
} |
| akhmetovlz@61 | 24 |
|
| akhmetovlz@61 | 25 |
@Override |
| akhmetovlz@61 | 26 |
public ArrayList<Batch> getBatches() {
|
| akhmetovlz@61 | 27 |
ArrayList<Batch> retArray = new ArrayList<Batch>(); |
| akhmetovlz@61 | 28 |
|
| akhmetovlz@61 | 29 |
Slot processingSlot = Run.getProponent().getSlot(processingSlotIndex); |
| akhmetovlz@61 | 30 |
|
| akhmetovlz@61 | 31 |
numberIntoSlotField(Run.getRegisterByIndex(0), donorSlotIndex); |
| akhmetovlz@61 | 32 |
numberIntoSlotField(Run.getRegisterByIndex(1), targetSlotIndex); |
| akhmetovlz@61 | 33 |
numberIntoSlotField(Run.getRegisterByIndex(2), pointsSlotIndex); |
| akhmetovlz@61 | 34 |
|
| akhmetovlz@61 | 35 |
retArray.addAll(BcombineForFunctWith3ParamsInRegister(new Attack(), processingSlot)); |
| akhmetovlz@61 | 36 |
|
| akhmetovlz@61 | 37 |
return retArray; |
| akhmetovlz@61 | 38 |
} |
| akhmetovlz@61 | 39 |
|
| akhmetovlz@61 | 40 |
|
| akhmetovlz@61 | 41 |
|
| akhmetovlz@61 | 42 |
} |