diff -r 0e21db22ecec -r 743564afa994 src/main/java/ru/alphatech/icfpc/cards/Revive.java --- a/src/main/java/ru/alphatech/icfpc/cards/Revive.java Sun Jun 19 10:50:46 2011 +0400 +++ b/src/main/java/ru/alphatech/icfpc/cards/Revive.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; @@ -12,20 +13,22 @@ if (value.getClass().equals(Value.class)) { int i = ((Value)value).getValue(); - if (proponent.getSlot(i).getVitality() <= 0) + if (i >= 0 && i < 256) { - proponent.getSlot(i).setVitality(1); + if (proponent.getSlot(i).getVitality() <= 0) + { + proponent.getSlot(i).setVitality(1); + } } - - return new ICard() + else { - @Override - public IValue returnValue(IValue value, Player proponent, Player opponent) - { - return value; - } - }; + throw new ICFPCException(); + } } - return null; + else + { + throw new ICFPCException(); + } + return new I(); } }