equal
deleted
inserted
replaced
6 import ru.alphatech.icfpc.game.Value; |
6 import ru.alphatech.icfpc.game.Value; |
7 |
7 |
8 public class Copy implements ICard |
8 public class Copy implements ICard |
9 { |
9 { |
10 @Override |
10 @Override |
11 public IValue returnValue(IValue i, Player proponent, Player opponent) |
11 public IValue returnValue(IValue iobj, Player proponent, Player opponent) |
12 { |
12 { |
13 if (i.getClass().equals(Value.class)) |
13 if (iobj instanceof Value) |
14 { |
14 { |
15 int iVal = ((Value)i).getValue(); |
15 int i = ((Value)iobj).getValue(); |
16 if (iVal >= 0 && iVal < 256) |
16 |
|
17 if (i >= 0 && i <= 255) |
17 { |
18 { |
18 return opponent.getSlot(((Value)i).getValue()).getValue(); |
19 return opponent.getSlot(i).getValue(); |
19 } |
20 } |
20 else |
21 else |
21 { |
22 { |
22 throw new ICFPCException(); |
23 throw new ICFPCException(); |
23 } |
24 } |