diff -r cc814352ab43 -r bb440d1c3ea4 src/main/java/ru/alphatech/icfpc/game/Player.java --- a/src/main/java/ru/alphatech/icfpc/game/Player.java Sun Jun 19 19:13:07 2011 +0400 +++ b/src/main/java/ru/alphatech/icfpc/game/Player.java Sun Jun 19 19:13:46 2011 +0400 @@ -1,11 +1,14 @@ package ru.alphatech.icfpc.game; +import ru.alphatech.icfpc.cards.I; + public class Player { private Slot[] slots = new Slot[256]; - + private Player myOpponent = null; + public Player() { for(int i = 0; i < 255; i++) @@ -14,6 +17,14 @@ } } + public Player getMyOpponent() { + return myOpponent; + } + + public void setMyOpponent(Player myOpponent) { + this.myOpponent = myOpponent; + } + public Slot getSlot(int i) { return slots[i]; @@ -24,7 +35,14 @@ } public void applyBatch(Batch batch){ - + switch(batch.operationType){ + case CARD_TO_SLOT: + batch.card.returnValue(getSlot(batch.slot.getId()).getValue(), this, myOpponent); + break; + case SLOT_TO_CARD: + getSlot(batch.slot.getId()).getValue().returnValue(batch.card, this, myOpponent); + break; + } } }