}
for (int i=0; i< size; i++)
{
MatchStackItem item = mMatch.getStackLastItems().elementAt(i);
EAIAction action = null;
// ensure in all Cards
// in Match, instant stack cards
// that are played as instant stack cards
// are removed from hand - so this card can not be found anywhere else in match!
// this was done to ensure the
// player would not play that card again and again in stack reactions
// here we have to make sure
// that a single CardSim exists!
CardSim test = allCards.get(item.card.getUniqueID());
if (test == null)
{
test = new CardSim(item.card, mMatch.getIntOwner(item.card));
allCards.put( item.card.toUString(), test);
}
Vector<EAIAction> targets = null;
// Mana is allways null
// since mana is already payed, when action is on stack!
if (item.ev != null)
{
targets = new Vector<EAIAction>();
if (item.ev.targetCard != null)
{
EAIAction tAction = EAIAction.createTargetAction(i, mMatch.getPhase(), item.ev.targetCard, -1);
tAction.isTarget = true;
tAction.isSource = false;
targets.add(tAction);
}
if (item.ev.sourceCard != null)
{
EAIAction tAction = EAIAction.createTargetAction(i, mMatch.getPhase(), item.ev.sourceCard, -1);
tAction.isTarget = false;
tAction.isSource = true;
targets.add(tAction);
}
if (item.ev.targetPlayer != null)
{
int player = mMatch.getMyNumber(item.ev.targetPlayer);
EAIAction tAction = EAIAction.createTargetAction(i, mMatch.getPhase(), (Card) null, player);
tAction.isTarget = true;
tAction.isSource = false;
targets.add(tAction);
}
}