1.1 --- a/src/main/java/ru/alphatech/icfpc/game/Player.java Sat Jun 18 19:45:20 2011 +0400
1.2 +++ b/src/main/java/ru/alphatech/icfpc/game/Player.java Sat Jun 18 19:46:50 2011 +0400
1.3 @@ -1,5 +1,7 @@
1.4 package ru.alphatech.icfpc.game;
1.5
1.6 +import ru.alphatech.icfpc.cards.ICard;
1.7 +
1.8
1.9 public class Player
1.10 {
1.11 @@ -7,4 +9,16 @@
1.12 {
1.13 throw new RuntimeException("Not impilemented yet.");
1.14 }
1.15 +
1.16 + public void applyCardToSlot(ICard card, Slot slot){
1.17 + throw new RuntimeException("Not impilemented yet.");
1.18 + }
1.19 +
1.20 + public void applySlotToCard(Slot slot, ICard card){
1.21 + throw new RuntimeException("Not impilemented yet.");
1.22 + }
1.23 +
1.24 + public PlayerStatistic getStatistic(){
1.25 + throw new RuntimeException("Not impilemented yet.");
1.26 + }
1.27 }
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/src/main/java/ru/alphatech/icfpc/game/PlayerStatistic.java Sat Jun 18 19:46:50 2011 +0400
2.3 @@ -0,0 +1,11 @@
2.4 +package ru.alphatech.icfpc.game;
2.5 +
2.6 +public class PlayerStatistic {
2.7 +
2.8 + public int maxValueSlotNum = -1;
2.9 + public int maxValue = -1;
2.10 + public int midleValue= -1;
2.11 + public int maxVitalitySlotNum = -1;
2.12 + public int maxVitality = -1;
2.13 +
2.14 +}
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/src/main/java/ru/alphatech/icfpc/policy/AbstractPolicy.java Sat Jun 18 19:46:50 2011 +0400
3.3 @@ -0,0 +1,35 @@
3.4 +package ru.alphatech.icfpc.policy;
3.5 +
3.6 +import ru.alphatech.icfpc.game.Player;
3.7 +
3.8 +public abstract class AbstractPolicy {
3.9 +
3.10 + protected Player player = null;
3.11 +
3.12 + private int turnCount = 0;
3.13 + private int turnCurrent = 0;
3.14 +
3.15 + public AbstractPolicy(int turnCount, Player player){
3.16 + this.player = player;
3.17 + this.turnCount = turnCount;
3.18 + this.turnCurrent = 0;
3.19 + }
3.20 +
3.21 + public int getCurrentTurns() {
3.22 + return turnCurrent;
3.23 + }
3.24 +
3.25 + public int getTurnsCount(){
3.26 + return turnCount;
3.27 + }
3.28 +
3.29 + public boolean next(){
3.30 + if( turnCurrent < turnCount ){
3.31 + turnCurrent++;
3.32 + return true;
3.33 + }
3.34 + return false;
3.35 + }
3.36 +
3.37 +
3.38 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/src/main/java/ru/alphatech/icfpc/policy/VitalityBoostPolicy.java Sat Jun 18 19:46:50 2011 +0400
4.3 @@ -0,0 +1,52 @@
4.4 +package ru.alphatech.icfpc.policy;
4.5 +
4.6 +import ru.alphatech.icfpc.cards.Dbl;
4.7 +import ru.alphatech.icfpc.cards.Succ;
4.8 +import ru.alphatech.icfpc.cards.Zero;
4.9 +import ru.alphatech.icfpc.game.Player;
4.10 +
4.11 +public class VitalityBoostPolicy extends AbstractPolicy {
4.12 +
4.13 + public static final int turnsCount = 100;
4.14 +
4.15 + public VitalityBoostPolicy(int targetSlot, Player player) {
4.16 + super(turnsCount, player);
4.17 + this.targetSlot = targetSlot;
4.18 +
4.19 + maxValueSlotNum = player.getStatistic().maxValueSlotNum;
4.20 + maxValue = player.getStatistic().maxValue;
4.21 + firstIdentitySlot = -1;
4.22 + }
4.23 +
4.24 + protected int targetSlot = -1;
4.25 + protected int maxValueSlotNum = -1;
4.26 + protected int maxValue = -1;
4.27 + protected int firstIdentitySlot = -1;
4.28 +
4.29 + public boolean next() {
4.30 + if ( super.next() ){
4.31 +
4.32 + switch (getCurrentTurns()) {
4.33 + case 0:
4.34 + break;
4.35 + case 1:
4.36 + case 2:
4.37 + break;
4.38 + case 3:
4.39 + case 4:
4.40 + case 5:
4.41 + case 6:
4.42 + case 7:
4.43 + case 8:
4.44 + case 9:
4.45 + case 10:
4.46 + break;
4.47 + case 11:
4.48 + break;
4.49 + }
4.50 +
4.51 + }
4.52 + return false;
4.53 + }
4.54 +
4.55 +}