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;

public class Succ implements ICard
{
	@Override
	public IValue returnValue(IValue value, Player proponent, Player opponent)
	{
		if(value.getClass().equals(Value.class))
		{
			if (((Value)value).getValue() >= 65535)
			{
				return new Value(65535);
			}
			return new Value(((Value)value).getValue() + 1);
		}
		else
		{
			throw new ICFPCException();
		}
	}
}
