1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/main/java/ru/alphatech/icfpc/policy/VitalityBoostPolicy.java Sat Jun 18 19:40:17 2011 +0400
1.3 @@ -0,0 +1,55 @@
1.4 +package ru.alphatech.icfpc.policy;
1.5 +
1.6 +import ru.alphatech.icfpc.cards.Dbl;
1.7 +import ru.alphatech.icfpc.cards.Succ;
1.8 +import ru.alphatech.icfpc.cards.Zero;
1.9 +import ru.alphatech.icfpc.game.Player;
1.10 +
1.11 +public class VitalityBoostPolicy extends AbstractPolicy {
1.12 +
1.13 + public static final int turnsCount = 100;
1.14 +
1.15 + public VitalityBoostPolicy(int targetSlot, Player player) {
1.16 + super(turnsCount, player);
1.17 + this.targetSlot = targetSlot;
1.18 +
1.19 + maxValueSlotNum = player.getStatistic().maxValueSlotNum;
1.20 + maxValue = player.getStatistic().maxValue;
1.21 + firstIdentitySlot = -1;
1.22 + }
1.23 +
1.24 + protected int targetSlot = -1;
1.25 + protected int maxValueSlotNum = -1;
1.26 + protected int maxValue = -1;
1.27 + protected int firstIdentitySlot = -1;
1.28 +
1.29 + public boolean next() {
1.30 + if ( super.next() ){
1.31 +
1.32 + switch (getCurrentTurns()) {
1.33 + case 0:
1.34 + player.applySlotToCard(player.getSlot(firstIdentitySlot), );
1.35 + break;
1.36 + case 1:
1.37 + case 2:
1.38 + player.applyCardToSlot(new Succ(), player.getSlot(incValueSlotNum));
1.39 + break;
1.40 + case 3:
1.41 + case 4:
1.42 + case 5:
1.43 + case 6:
1.44 + case 7:
1.45 + case 8:
1.46 + case 9:
1.47 + case 10:
1.48 + player.applyCardToSlot(new Dbl(), player.getSlot(incValueSlotNum));
1.49 + break;
1.50 + case 11:
1.51 + break;
1.52 + }
1.53 +
1.54 + }
1.55 + return false;
1.56 + }
1.57 +
1.58 +}