Corrected test and Put card.
1 package ru.alphatech.icfpc.game;
3 import ru.alphatech.icfpc.cards.I;
4 import ru.alphatech.icfpc.cards.ICard;
5 import ru.alphatech.icfpc.cards.Zero;
11 private Slot[] slots = new Slot[256];
12 private Player myOpponent = null;
16 for(int i = 0; i <= 255; i++)
18 slots[i] = new Slot(i);
22 public Player getMyOpponent() {
26 public void setMyOpponent(Player myOpponent) {
27 this.myOpponent = myOpponent;
30 public Slot getSlot(int i)
35 public PlayerStatistic getStatistic(){
36 throw new RuntimeException("Not impilemented yet.");
39 public void applyBatch(Batch batch){
40 Run.setAutoMode(false);
43 switch(batch.operationType){
45 IValue value = getSlot(batch.slot.getId()).getValue();
47 if(value instanceof Zero)
52 if(batch.card instanceof Zero)
54 batch.card = (ICard) new Value(0);
57 batch.card.returnValue(value, this, myOpponent);
60 getSlot(batch.slot.getId()).getValue().returnValue(batch.card, this, myOpponent);
63 } catch (ICFPCException exception){
64 getSlot(batch.slot.getId()).putValue(new I());
66 Run.setAutoMode(true);
68 for(Slot slot: myOpponent.slots){
70 slot.getValue().returnValue(new I(), myOpponent, myOpponent.getMyOpponent());