1.1 --- a/src/main/java/ru/alphatech/icfpc/cards/Revive.java Sun Jun 19 10:50:46 2011 +0400
1.2 +++ b/src/main/java/ru/alphatech/icfpc/cards/Revive.java Sun Jun 19 12:12:55 2011 +0400
1.3 @@ -1,5 +1,6 @@
1.4 package ru.alphatech.icfpc.cards;
1.5
1.6 +import ru.alphatech.icfpc.game.ICFPCException;
1.7 import ru.alphatech.icfpc.game.IValue;
1.8 import ru.alphatech.icfpc.game.Player;
1.9 import ru.alphatech.icfpc.game.Value;
1.10 @@ -12,20 +13,22 @@
1.11 if (value.getClass().equals(Value.class))
1.12 {
1.13 int i = ((Value)value).getValue();
1.14 - if (proponent.getSlot(i).getVitality() <= 0)
1.15 + if (i >= 0 && i < 256)
1.16 {
1.17 - proponent.getSlot(i).setVitality(1);
1.18 + if (proponent.getSlot(i).getVitality() <= 0)
1.19 + {
1.20 + proponent.getSlot(i).setVitality(1);
1.21 + }
1.22 }
1.23 -
1.24 - return new ICard()
1.25 + else
1.26 {
1.27 - @Override
1.28 - public IValue returnValue(IValue value, Player proponent, Player opponent)
1.29 - {
1.30 - return value;
1.31 - }
1.32 - };
1.33 + throw new ICFPCException();
1.34 + }
1.35 }
1.36 - return null;
1.37 + else
1.38 + {
1.39 + throw new ICFPCException();
1.40 + }
1.41 + return new I();
1.42 }
1.43 }