added method to get stack item based on event
parent
a1cfc8f2ce
commit
a18fe6b0b5
|
@ -7,6 +7,7 @@ import magic.model.MagicCopyMap;
|
|||
import magic.model.MagicPlayer;
|
||||
import magic.model.MagicSource;
|
||||
import magic.model.event.MagicActivation;
|
||||
import magic.model.event.MagicEvent;
|
||||
|
||||
public class MagicStack extends LinkedList<MagicItemOnStack> {
|
||||
|
||||
|
@ -28,6 +29,15 @@ public class MagicStack extends LinkedList<MagicItemOnStack> {
|
|||
}
|
||||
}
|
||||
|
||||
public MagicItemOnStack get(final MagicEvent event) {
|
||||
for (final MagicItemOnStack item : this) {
|
||||
if (item.getEvent() == event) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void addCount(final MagicItemOnStack itemOnStack) {
|
||||
final int index=itemOnStack.getController().getIndex();
|
||||
counts[index]++;
|
||||
|
|
Loading…
Reference in New Issue