diff -r 2c8b98d4efb8 -r a84a3c755d93 src/main/java/ru/alphatech/icfpc/cards/Revive.java --- a/src/main/java/ru/alphatech/icfpc/cards/Revive.java Sun Jun 19 14:30:33 2011 +0400 +++ b/src/main/java/ru/alphatech/icfpc/cards/Revive.java Sun Jun 19 15:04:59 2011 +0400 @@ -8,17 +8,22 @@ public class Revive implements ICard { @Override - public IValue returnValue(IValue value, Player proponent, Player opponent) + public IValue returnValue(IValue iobj, Player proponent, Player opponent) { - if (value.getClass().equals(Value.class)) + if (iobj instanceof Value) { - int i = ((Value)value).getValue(); - if (i >= 0 && i < 256) + int i = ((Value)iobj).getValue(); + + if (i >= 0 && i <= 255) { - if (proponent.getSlot(i).getVitality() <= 0) + int v = proponent.getSlot(i).getVitality(); + + if (v <= 0) { proponent.getSlot(i).setVitality(1); } + + return new I(); } else { @@ -29,6 +34,5 @@ { throw new ICFPCException(); } - return new I(); } }