1.1 --- a/src/main/java/ru/alphatech/icfpc/game/Batch.java Sun Jun 19 17:53:59 2011 +0400
1.2 +++ b/src/main/java/ru/alphatech/icfpc/game/Batch.java Sun Jun 19 18:42:07 2011 +0400
1.3 @@ -15,9 +15,31 @@
1.4 public Slot slot = null;
1.5
1.6 public Batch(OperationType type, ICard card, Slot slot){
1.7 + if(type == null || card == null || slot == null)
1.8 + throw new ICFPCException("Illegal constructor using!");
1.9 this.operationType = type;
1.10 this.card = card;
1.11 this.slot = slot;
1.12 }
1.13 +
1.14 + @Override
1.15 + public String toString() {
1.16 + if(operationType == null || card == null || slot == null)
1.17 + throw new ICFPCException();
1.18 + StringBuilder ret = new StringBuilder();
1.19 + switch(operationType){
1.20 + case CARD_TO_SLOT:
1.21 + ret.append("1\n");
1.22 + ret.append(card.getName() + "\n");
1.23 + ret.append(slot.getId() + "\n");
1.24 + break;
1.25 + case SLOT_TO_CARD:
1.26 + ret.append("2\n");
1.27 + ret.append(slot.getId() + "\n");
1.28 + ret.append(card.getName() + "\n");
1.29 + break;
1.30 + }
1.31 + return ret.toString();
1.32 + }
1.33
1.34 }