src/main/java/ru/alphatech/icfpc/game/Batch.java
changeset 86 22bad86100ac
parent 80 fcdce54b2f25
child 96 8c40512777a1
equal deleted inserted replaced
85:7292b7aea7e3 86:22bad86100ac
    17 	public Batch(OperationType type, ICard card, Slot slot){
    17 	public Batch(OperationType type, ICard card, Slot slot){
    18 		this.operationType = type;
    18 		this.operationType = type;
    19 		this.card = card;
    19 		this.card = card;
    20 		this.slot = slot;
    20 		this.slot = slot;
    21 	}
    21 	}
       
    22 
       
    23 	@Override
       
    24 	public String toString() {
       
    25 		if(operationType == null || card == null || slot == null)
       
    26 			throw new ICFPCException();
       
    27 		StringBuilder ret = new StringBuilder();
       
    28 		switch(operationType){
       
    29 		case CARD_TO_SLOT:
       
    30 			ret.append("1\n");
       
    31 			ret.append(card.getName() + "\n");
       
    32 			ret.append(slot.getId() + "\n");
       
    33 			break;
       
    34 		case SLOT_TO_CARD:
       
    35 			ret.append("2\n");
       
    36 			ret.append(slot.getId() + "\n");
       
    37 			ret.append(card.getName() + "\n");
       
    38 			break;
       
    39 		}
       
    40 		return ret.toString();
       
    41 	}
    22 	
    42 	
    23 }
    43 }