|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.stack.TargetHelper
public final class TargetHelper
Field Summary | |
---|---|
static java.lang.String |
STR_CONTEXT1
Code to represent the context of a spell. |
static java.lang.String |
STR_CONTEXT2
Code to represent the context2 of a spell. |
static java.lang.String |
STR_SOURCE
Code to represent the source of target action. |
Method Summary | |
---|---|
void |
addTargetedBy(StackContext stackContext)
Add a target Id displayed on each targeted components. |
boolean |
checkTarget(Ability ability,
MCard source,
Test test,
int type,
int choiceMode,
ContextEventListener context,
int restrictionZone,
int hopCounter,
boolean canBePreempted)
Return true when there is the required amount of valid
targets. |
static TargetHelper |
getInstance()
Return the unique instance of this class. |
java.lang.String |
getMyId(Targetable targetable)
Return the target id of given component. |
java.lang.String |
getTargetPictureAsUrl()
Return Url picture used to draw a targeted component when it is added to the current target list. |
java.awt.Image |
getTargetPictureSml()
Return picture used to draw a targeted component when it is added to the current target list. |
void |
removeTargetedBy()
Remove any target Id displayed on targeted components. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STR_SOURCE
public static final java.lang.String STR_CONTEXT1
public static final java.lang.String STR_CONTEXT2
Method Detail |
---|
public static TargetHelper getInstance()
public boolean checkTarget(Ability ability, MCard source, Test test, int type, int choiceMode, ContextEventListener context, int restrictionZone, int hopCounter, boolean canBePreempted)
true
when there is the required amount of valid
targets.
ability
- is the ability owning this test. The card component of this
ability should correspond to the card owning this test too.source
- the card source of the target. Often is the card owning the
current ability.test
- the constraint applied on the target. This test must be true to
make valid a target.type
- the target type (player, card, both)choiceMode
- the choice mode like random, all, choosen by playerX,...context
- the associated context of current ability.restrictionZone
- the restriction zone. If is -1
the scan would be
processed on all zones.hopCounter
- the minimum amount of target looked for. For optimisation purpose.canBePreempted
- true
if the valid targets can be derterminated
before runtime.
true
when there is the required amount of valid
targets.public void addTargetedBy(StackContext stackContext)
stackContext
- the stack context of source.public void removeTargetedBy()
public java.awt.Image getTargetPictureSml()
public java.lang.String getTargetPictureAsUrl()
public java.lang.String getMyId(Targetable targetable)
targetable
- the component requesting it's target id.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |