equal
deleted
inserted
replaced
|
1 package ru.alphatech.icfpc.policy; |
|
2 |
|
3 import ru.alphatech.icfpc.cards.Dbl; |
|
4 import ru.alphatech.icfpc.cards.Succ; |
|
5 import ru.alphatech.icfpc.cards.Zero; |
|
6 import ru.alphatech.icfpc.game.Player; |
|
7 |
|
8 public class VitalityBoostPolicy extends AbstractPolicy { |
|
9 |
|
10 public static final int turnsCount = 100; |
|
11 |
|
12 public VitalityBoostPolicy(int targetSlot, Player player) { |
|
13 super(turnsCount, player); |
|
14 this.targetSlot = targetSlot; |
|
15 |
|
16 maxValueSlotNum = player.getStatistic().maxValueSlotNum; |
|
17 maxValue = player.getStatistic().maxValue; |
|
18 firstIdentitySlot = -1; |
|
19 } |
|
20 |
|
21 protected int targetSlot = -1; |
|
22 protected int maxValueSlotNum = -1; |
|
23 protected int maxValue = -1; |
|
24 protected int firstIdentitySlot = -1; |
|
25 |
|
26 public boolean next() { |
|
27 if ( super.next() ){ |
|
28 |
|
29 switch (getCurrentTurns()) { |
|
30 case 0: |
|
31 player.applySlotToCard(player.getSlot(firstIdentitySlot), ); |
|
32 break; |
|
33 case 1: |
|
34 case 2: |
|
35 player.applyCardToSlot(new Succ(), player.getSlot(incValueSlotNum)); |
|
36 break; |
|
37 case 3: |
|
38 case 4: |
|
39 case 5: |
|
40 case 6: |
|
41 case 7: |
|
42 case 8: |
|
43 case 9: |
|
44 case 10: |
|
45 player.applyCardToSlot(new Dbl(), player.getSlot(incValueSlotNum)); |
|
46 break; |
|
47 case 11: |
|
48 break; |
|
49 } |
|
50 |
|
51 } |
|
52 return false; |
|
53 } |
|
54 |
|
55 } |