src/main/java/ru/alphatech/icfpc/cards/Dec.java
author akhmetovlz
Sun, 19 Jun 2011 11:59:52 +0400
changeset 34 85894dec2280
parent 12 042162c73d0f
child 35 743564afa994
permissions -rw-r--r--
Hey
     1 package ru.alphatech.icfpc.cards;
     2 
     3 import ru.alphatech.icfpc.game.IValue;
     4 import ru.alphatech.icfpc.game.Player;
     5 import ru.alphatech.icfpc.game.Value;
     6 
     7 public class Dec implements ICard
     8 {
     9 	@Override
    10 	public IValue returnValue(IValue value, Player proponent, Player opponent)
    11 	{
    12 		if(value.getClass().equals(Value.class))
    13 		{
    14 			if (((Value)value).getValue() < 256 && ((Value)value).getValue() > -1)
    15 			{
    16 				opponent.getSlot(((Value)value).getValue()).setVitality(opponent.getSlot(((Value)value).getValue()).getVitality() - 1);
    17 				return new ICard()
    18 				{
    19 					@Override
    20 					public IValue returnValue(IValue value, Player proponent, Player opponent)
    21 					{
    22 						return value;
    23 					}
    24 				};
    25 			}
    26 		}
    27 
    28 		return new Value(-100);
    29 	}
    30 }