Cards dec and inc.
1 package ru.alphatech.icfpc.cards;
3 import ru.alphatech.icfpc.game.ICFPCException;
4 import ru.alphatech.icfpc.game.IValue;
5 import ru.alphatech.icfpc.game.Player;
6 import ru.alphatech.icfpc.game.Value;
8 public class Revive implements ICard
11 public IValue returnValue(IValue value, Player proponent, Player opponent)
13 if (value.getClass().equals(Value.class))
15 int i = ((Value)value).getValue();
16 if (i >= 0 && i < 256)
18 if (proponent.getSlot(i).getVitality() <= 0)
20 proponent.getSlot(i).setVitality(1);
25 throw new ICFPCException();
30 throw new ICFPCException();