diff -r 0e21db22ecec -r 743564afa994 src/main/java/ru/alphatech/icfpc/cards/Inc.java --- a/src/main/java/ru/alphatech/icfpc/cards/Inc.java Sun Jun 19 10:50:46 2011 +0400 +++ b/src/main/java/ru/alphatech/icfpc/cards/Inc.java Sun Jun 19 12:12:55 2011 +0400 @@ -1,5 +1,6 @@ package ru.alphatech.icfpc.cards; +import ru.alphatech.icfpc.game.ICFPCException; import ru.alphatech.icfpc.game.IValue; import ru.alphatech.icfpc.game.Player; import ru.alphatech.icfpc.game.Value; @@ -11,20 +12,26 @@ { if(value.getClass().equals(Value.class)) { - if (((Value)value).getValue() < 256 && ((Value)value).getValue() > -1) + int i = ((Value)value).getValue(); + + if (i < 256 && i > 0) { - proponent.getSlot(((Value)value).getValue()).setVitality(proponent.getSlot(((Value)value).getValue()).getVitality() + 1); - return new ICard() + int v = proponent.getSlot(i).getVitality(); + if (v < 65535 && v > 0) { - @Override - public IValue returnValue(IValue value, Player proponent, Player opponent) - { - return value; - } - }; + proponent.getSlot(i).setVitality(v + 1); + } + } + else + { + throw new ICFPCException(); } } + else + { + throw new ICFPCException(); + } - return new Value(-100); + return new I(); } }