src/main/java/ru/alphatech/icfpc/cards/Zombie.java
author Azamat S. Kalimoulline <turtle@bazon.ru>
Sun, 19 Jun 2011 13:32:30 +0400
changeset 50 83ff9504b901
parent 35 743564afa994
child 68 a84a3c755d93
permissions -rw-r--r--
Merge with 7e49c679fc70fb49d5168b5a9783a10088f171e0
     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 Zombie implements ICard
     8 {
     9 	@Override
    10 	public IValue returnValue(final IValue iVal, Player proponent, Player opponent)
    11 	{
    12 		return new ICard()
    13 		{
    14 			@Override
    15 			public IValue returnValue(final IValue x, Player proponent, Player opponent)
    16 			{
    17 				if (iVal.getClass().equals(Value.class))
    18 				{
    19 					int i = ((Value)iVal).getValue();
    20 					if (i >= 0 && i < 256)
    21 					{
    22 						opponent.getSlot(i).putValue(x);
    23 						opponent.getSlot(i).setVitality(-1);
    24 					}
    25 				}
    26 				return new I();
    27 			}
    28 		};
    29 	}
    30 }