1.1 --- a/src/main/java/ru/alphatech/icfpc/cards/Inc.java Sun Jun 19 10:50:46 2011 +0400
1.2 +++ b/src/main/java/ru/alphatech/icfpc/cards/Inc.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 @@ -11,20 +12,26 @@
1.11 {
1.12 if(value.getClass().equals(Value.class))
1.13 {
1.14 - if (((Value)value).getValue() < 256 && ((Value)value).getValue() > -1)
1.15 + int i = ((Value)value).getValue();
1.16 +
1.17 + if (i < 256 && i > 0)
1.18 {
1.19 - proponent.getSlot(((Value)value).getValue()).setVitality(proponent.getSlot(((Value)value).getValue()).getVitality() + 1);
1.20 - return new ICard()
1.21 + int v = proponent.getSlot(i).getVitality();
1.22 + if (v < 65535 && v > 0)
1.23 {
1.24 - @Override
1.25 - public IValue returnValue(IValue value, Player proponent, Player opponent)
1.26 - {
1.27 - return value;
1.28 - }
1.29 - };
1.30 + proponent.getSlot(i).setVitality(v + 1);
1.31 + }
1.32 + }
1.33 + else
1.34 + {
1.35 + throw new ICFPCException();
1.36 }
1.37 }
1.38 + else
1.39 + {
1.40 + throw new ICFPCException();
1.41 + }
1.42
1.43 - return new Value(-100);
1.44 + return new I();
1.45 }
1.46 }