1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package net.sf.magicproject.test;
22
23 import java.io.IOException;
24 import java.io.InputStream;
25
26 import net.sf.magicproject.annotation.XmlTestElement;
27 import net.sf.magicproject.clickable.ability.Ability;
28 import net.sf.magicproject.clickable.targetable.Targetable;
29
30 /***
31 * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
32 * @since 0.83
33 */
34 @XmlTestElement(id = IdTest.IS_ABILITY)
35 public class IsAbility extends TestObject {
36
37 /***
38 * Create an instance of IsAbility by reading a file. Offset's file must
39 * pointing on the first byte of this test <br>
40 * <ul>
41 * Structure of InputStream : Data[size]
42 * </ul>
43 *
44 * @param inputFile
45 * is the file containing this test
46 * @throws IOException
47 * if error occurred during the reading process from the specified
48 * input stream
49 */
50 IsAbility(InputStream inputFile) throws IOException {
51 super(inputFile);
52 }
53
54 @Override
55 public boolean test(Ability ability, Targetable tested) {
56 return on.getTargetable(ability, tested).isAbility();
57 }
58
59 }