|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.magicproject.stack.TargetedList
public class TargetedList
MTargetedList.java Created on 8 oct. 2003 represents list of targets : player(s) and/or card(s).
Card
,
Player
Field Summary | |
---|---|
java.util.List<Targetable> |
list
represents all targeted card(s) and/or player(s) |
Ability |
source
Source of this target spell/ability |
Constructor Summary | |
---|---|
TargetedList(Ability source)
Creates a new instance of MTargetedList |
Method Summary | |
---|---|
void |
addTarget(int eventOption,
Targetable targeted,
Test test,
boolean raiseEvent)
Add a player/card to the targeted list If the current target options indicates that an event has to be generated when a target is choosen, the event Targeted is dispatched. |
void |
clear()
Indicates that we're no longer looking for the targets |
TargetedList |
cloneList()
Return a clone of this list. |
Targetable |
get(int index)
Return the target placed at index |
Targetable |
getFirst()
Return the first target |
Targetable |
getLast()
Return the last target |
boolean |
isEmpty()
Indicates if there are targets |
int |
recheckList(Ability ability)
Recheck the whole list of targets added with raised event. |
void |
remove(int index)
Return a target from the list |
void |
remove(Targetable target)
Return the specified target from the list |
void |
removeLast()
Remove the last target |
void |
removeQueue()
Remove all component but the first. |
void |
removeTail()
Remove all component but the last. |
void |
removeTargeted(Targetable target)
Return the specified target from the list |
int |
size()
Retourne la taille de la liste |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.util.List<Targetable> list
public Ability source
Constructor Detail |
---|
public TargetedList(Ability source)
source
- the source of this list of targetsMethod Detail |
---|
public void addTarget(int eventOption, Targetable targeted, Test test, boolean raiseEvent)
eventOption
- is the event mode : Force, default, none. Depending this value,
the added target will be rechecked before resolution processtargeted
- the player to add to the listtest
- is the used filter. All objects making false this test are removed
from the specified list and from the constraint really targeted
list.raiseEvent
- if false, is any case, no event can be triggered.public Targetable get(int index)
index
- the target register to extract from the list
public Targetable getLast()
public Targetable getFirst()
public void removeLast()
public void remove(int index)
index
- the index of the element to be removed.public void remove(Targetable target)
target
- the target to be removed.public void removeTargeted(Targetable target)
target
- the target to be removed.public void removeQueue()
public void removeTail()
public boolean isEmpty()
public int size()
public void clear()
public int recheckList(Ability ability)
ability
- is the ability owning this request. The card component of this
ability should correspond to the card owning this request too.
public TargetedList cloneList()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |