| author | akhmetovlz |
| Mon, 20 Jun 2011 01:42:04 +0400 | |
| changeset 120 | f8c080bbb572 |
| permissions | -rw-r--r-- |
| akhmetovlz@120 | 1 |
package ru.alphatech.icfpc.policy; |
| akhmetovlz@120 | 2 |
|
| akhmetovlz@120 | 3 |
import java.util.ArrayList; |
| akhmetovlz@120 | 4 |
|
| akhmetovlz@120 | 5 |
import ru.alphatech.icfpc.game.AbstractPolicy; |
| akhmetovlz@120 | 6 |
import ru.alphatech.icfpc.game.Batch; |
| akhmetovlz@120 | 7 |
import ru.alphatech.icfpc.game.Run; |
| akhmetovlz@120 | 8 |
import ru.alphatech.icfpc.game.Slot; |
| akhmetovlz@120 | 9 |
|
| akhmetovlz@120 | 10 |
/** |
| akhmetovlz@120 | 11 |
* Задать значение слота |
| akhmetovlz@120 | 12 |
* @author akhmetovlz |
| akhmetovlz@120 | 13 |
* |
| akhmetovlz@120 | 14 |
*/ |
| akhmetovlz@120 | 15 |
public class SetSlotValuePolicy extends AbstractPolicy{
|
| akhmetovlz@120 | 16 |
|
| akhmetovlz@120 | 17 |
int targetSlotIndex = -1; |
| akhmetovlz@120 | 18 |
int value = -1; |
| akhmetovlz@120 | 19 |
|
| akhmetovlz@120 | 20 |
public SetSlotValuePolicy(int targetSlot, int value) {
|
| akhmetovlz@120 | 21 |
this.targetSlotIndex = targetSlot; |
| akhmetovlz@120 | 22 |
this.value = value; |
| akhmetovlz@120 | 23 |
} |
| akhmetovlz@120 | 24 |
|
| akhmetovlz@120 | 25 |
@Override |
| akhmetovlz@120 | 26 |
public ArrayList<Batch> getBatches() {
|
| akhmetovlz@120 | 27 |
Slot targetSlot = Run.getProponent().getSlot(targetSlotIndex); |
| akhmetovlz@120 | 28 |
return numberIntoSlotField(targetSlot, value); |
| akhmetovlz@120 | 29 |
} |
| akhmetovlz@120 | 30 |
|
| akhmetovlz@120 | 31 |
} |