Cards bugs revealed.
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 int playerNumber = -1;
13 private Slot[] slots = new Slot[256];
14 private Player myOpponent = null;
18 for(int i = 0; i <= 255; i++)
20 slots[i] = new Slot(i);
24 public int getPlayerNumber() {
28 public void setPlayerNumber(int playerNumber) {
29 this.playerNumber = playerNumber;
32 public Player getMyOpponent() {
36 public void setMyOpponent(Player myOpponent) {
37 this.myOpponent = myOpponent;
40 public Slot getSlot(int i)
45 public PlayerStatistic getStatistic(){
46 throw new RuntimeException("Not implemented yet.");
49 public void applyBatch(Batch batch){
50 Run.setAutoMode(false);
53 switch(batch.operationType){
55 IValue value = getSlot(batch.slot.getId()).getValue();
57 if(value instanceof Zero)
62 if(batch.card instanceof Zero)
64 batch.card = (ICard) new Value(0);
67 getSlot(batch.slot.getId()).putValue(batch.card.returnValue(value, this, myOpponent));
70 IValue valueC = batch.card;
72 if(valueC instanceof Zero)
74 valueC = new Value(0);
77 getSlot(batch.slot.getId()).putValue(getSlot(batch.slot.getId()).getValue().returnValue(valueC, this, myOpponent));
80 } catch (ICFPCException exception){
81 getSlot(batch.slot.getId()).putValue(new I());
83 Run.setAutoMode(true);
85 for(Slot slot: myOpponent.slots){
87 slot.getValue().returnValue(new I(), myOpponent, myOpponent.getMyOpponent());