src/main/java/ru/alphatech/icfpc/cards/Succ.java
author akhmetovlz
Sun, 19 Jun 2011 14:34:54 +0400
changeset 66 8c820ab3cd8a
parent 43 4ba83edc4361
child 64 8ce8964b584f
permissions -rw-r--r--
Композиция
     1 package ru.alphatech.icfpc.cards;
     2 
     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;
     7 
     8 public class Succ implements ICard
     9 {
    10 	@Override
    11 	public IValue returnValue(IValue value, Player proponent, Player opponent)
    12 	{
    13 		if(value.getClass().equals(Value.class))
    14 		{
    15 			if (((Value)value).getValue() >= 65535)
    16 			{
    17 				return new Value(65535);
    18 			}
    19 			return new Value(((Value)value).getValue() + 1);
    20 		}
    21 		else
    22 		{
    23 			throw new ICFPCException();
    24 		}
    25 	}
    26 }