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