1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.magicproject.action.handler;
20
21 import net.sf.magicproject.action.context.ActionContextWrapper;
22 import net.sf.magicproject.clickable.ability.Ability;
23 import net.sf.magicproject.event.context.ContextEventListener;
24
25 /***
26 * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
27 * @since 0.86
28 */
29 public interface ChoosenAction extends Replayable {
30
31 /***
32 * No generated event. Let the active player playing this action.
33 *
34 * @param actionContext
35 * the context containing data saved by this action during the
36 * 'choose" proceess.
37 * @param ability
38 * is the ability owning this test. The card component of this
39 * ability should correspond to the card owning this test too.
40 * @param context
41 * is the context attached to this action.
42 * @return true if the stack can be resolved just after this call.
43 */
44 boolean choose(ActionContextWrapper actionContext,
45 ContextEventListener context, Ability ability);
46
47 /***
48 * No generated event. Unset this action as current one.
49 *
50 * @param actionContext
51 * the context containing data saved by this action during the
52 * 'choose" proceess.
53 * @param ability
54 * is the ability owning this test. The card component of this
55 * ability should correspond to the card owning this test too.
56 * @param context
57 * is the context attached to this action.
58 */
59 void disactivate(ActionContextWrapper actionContext,
60 ContextEventListener context, Ability ability);
61
62 /***
63 * Generate event associated to this action. Only one or several events are
64 * generated and may be collected by event listeners. Then play this action
65 *
66 * @param actionContext
67 * the context containing data saved by this action during the
68 * 'choose" proceess.
69 * @param ability
70 * is the ability owning this test. The card component of this
71 * ability should correspond to the card owning this test too.
72 * @param context
73 * is the context attached to this action.
74 * @return true if the stack can be resolved just after this call.
75 */
76 boolean replay(ActionContextWrapper actionContext,
77 ContextEventListener context, Ability ability);
78
79 /***
80 * Return the HTML code representing this action. If this action is named,
81 * it's name will be returned. If not, if existing, the picture associated to
82 * this action is returned. Otherwise, built-in action's text will be
83 * returned.
84 *
85 * @param ability
86 * is the ability owning this test. The card component of this
87 * ability should correspond to the card owning this test too.
88 * @return the HTML code representing this action. If this action is named,
89 * it's name will be returned. If not, if existing, the picture
90 * associated to this action is returned. Otherwise, built-in action's
91 * text will be returned.
92 * @param context
93 * is the context attached to this action.
94 * @param actionContext
95 * the context of this action.
96 * @since 0.86
97 */
98 String toHtmlString(Ability ability, ContextEventListener context,
99 ActionContextWrapper actionContext);
100 }