equal
deleted
inserted
replaced
8 import ru.alphatech.icfpc.cards.Succ; |
8 import ru.alphatech.icfpc.cards.Succ; |
9 import ru.alphatech.icfpc.cards.Zero; |
9 import ru.alphatech.icfpc.cards.Zero; |
10 import ru.alphatech.icfpc.game.Batch; |
10 import ru.alphatech.icfpc.game.Batch; |
11 import ru.alphatech.icfpc.game.IValue; |
11 import ru.alphatech.icfpc.game.IValue; |
12 import ru.alphatech.icfpc.game.Player; |
12 import ru.alphatech.icfpc.game.Player; |
|
13 import ru.alphatech.icfpc.game.Run; |
13 import ru.alphatech.icfpc.game.Slot; |
14 import ru.alphatech.icfpc.game.Slot; |
14 import ru.alphatech.icfpc.game.Value; |
15 import ru.alphatech.icfpc.game.Value; |
15 import ru.alphatech.icfpc.game.Batch.OperationType; |
16 import ru.alphatech.icfpc.game.Batch.OperationType; |
16 |
17 |
17 /** |
18 /** |
21 * @author akhmetovlz |
22 * @author akhmetovlz |
22 * |
23 * |
23 */ |
24 */ |
24 public abstract class AbstractPolicy { |
25 public abstract class AbstractPolicy { |
25 |
26 |
26 protected Player player = null; |
|
27 |
|
28 protected ArrayList<Batch> batches = new ArrayList<Batch>(); |
27 protected ArrayList<Batch> batches = new ArrayList<Batch>(); |
29 |
28 |
30 public AbstractPolicy(Player player){ |
29 public AbstractPolicy(){ |
31 this.player = player; |
|
32 } |
30 } |
33 |
31 |
34 public void setRegister(int registerIndex, int num ){ |
32 public void setRegister(int registerIndex, int num ){ |
35 if( registerIndex < 4) { |
33 if( registerIndex < 4) { |
36 Slot registerSlot = player.getRegisterByIndex(registerIndex); |
34 Slot registerSlot = Run.getRegisterByIndex(registerIndex); |
37 batches.addAll( numberIntoSlotField( registerSlot, num ) ); |
35 batches.addAll( numberIntoSlotField( registerSlot, num ) ); |
38 } |
36 } |
39 } |
37 } |
40 |
38 |
41 protected ArrayList<Batch> numberIntoSlotField(Slot targetSlot, int number) |
39 protected ArrayList<Batch> numberIntoSlotField(Slot targetSlot, int number) |