# HG changeset patch # User indvdum # Date 1308412010 -14400 # Node ID 7938ec9d4fe00d534c922ee42b332564402b8f5c # Parent 49c33971d0fb3eb57937b84e7745ccd1f7b85c9d# Parent b0748d48579070ec8761dfef670ce28f32108d92 * merging diff -r 49c33971d0fb -r 7938ec9d4fe0 src/main/java/ru/alphatech/icfpc/game/Player.java --- a/src/main/java/ru/alphatech/icfpc/game/Player.java Sat Jun 18 19:45:20 2011 +0400 +++ b/src/main/java/ru/alphatech/icfpc/game/Player.java Sat Jun 18 19:46:50 2011 +0400 @@ -1,5 +1,7 @@ package ru.alphatech.icfpc.game; +import ru.alphatech.icfpc.cards.ICard; + public class Player { @@ -7,4 +9,16 @@ { throw new RuntimeException("Not impilemented yet."); } + + public void applyCardToSlot(ICard card, Slot slot){ + throw new RuntimeException("Not impilemented yet."); + } + + public void applySlotToCard(Slot slot, ICard card){ + throw new RuntimeException("Not impilemented yet."); + } + + public PlayerStatistic getStatistic(){ + throw new RuntimeException("Not impilemented yet."); + } } diff -r 49c33971d0fb -r 7938ec9d4fe0 src/main/java/ru/alphatech/icfpc/game/PlayerStatistic.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/ru/alphatech/icfpc/game/PlayerStatistic.java Sat Jun 18 19:46:50 2011 +0400 @@ -0,0 +1,11 @@ +package ru.alphatech.icfpc.game; + +public class PlayerStatistic { + + public int maxValueSlotNum = -1; + public int maxValue = -1; + public int midleValue= -1; + public int maxVitalitySlotNum = -1; + public int maxVitality = -1; + +} diff -r 49c33971d0fb -r 7938ec9d4fe0 src/main/java/ru/alphatech/icfpc/policy/AbstractPolicy.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/ru/alphatech/icfpc/policy/AbstractPolicy.java Sat Jun 18 19:46:50 2011 +0400 @@ -0,0 +1,35 @@ +package ru.alphatech.icfpc.policy; + +import ru.alphatech.icfpc.game.Player; + +public abstract class AbstractPolicy { + + protected Player player = null; + + private int turnCount = 0; + private int turnCurrent = 0; + + public AbstractPolicy(int turnCount, Player player){ + this.player = player; + this.turnCount = turnCount; + this.turnCurrent = 0; + } + + public int getCurrentTurns() { + return turnCurrent; + } + + public int getTurnsCount(){ + return turnCount; + } + + public boolean next(){ + if( turnCurrent < turnCount ){ + turnCurrent++; + return true; + } + return false; + } + + +} diff -r 49c33971d0fb -r 7938ec9d4fe0 src/main/java/ru/alphatech/icfpc/policy/VitalityBoostPolicy.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/ru/alphatech/icfpc/policy/VitalityBoostPolicy.java Sat Jun 18 19:46:50 2011 +0400 @@ -0,0 +1,52 @@ +package ru.alphatech.icfpc.policy; + +import ru.alphatech.icfpc.cards.Dbl; +import ru.alphatech.icfpc.cards.Succ; +import ru.alphatech.icfpc.cards.Zero; +import ru.alphatech.icfpc.game.Player; + +public class VitalityBoostPolicy extends AbstractPolicy { + + public static final int turnsCount = 100; + + public VitalityBoostPolicy(int targetSlot, Player player) { + super(turnsCount, player); + this.targetSlot = targetSlot; + + maxValueSlotNum = player.getStatistic().maxValueSlotNum; + maxValue = player.getStatistic().maxValue; + firstIdentitySlot = -1; + } + + protected int targetSlot = -1; + protected int maxValueSlotNum = -1; + protected int maxValue = -1; + protected int firstIdentitySlot = -1; + + public boolean next() { + if ( super.next() ){ + + switch (getCurrentTurns()) { + case 0: + break; + case 1: + case 2: + break; + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + case 11: + break; + } + + } + return false; + } + +}