CardCollection setCards(CardCollection oldCards, CardCollection newCards, TrackableProperty key) { if (newCards == null || newCards.isEmpty()) { // avoid storing empty collections set(key, null); return null; } set(key, CardView.getCollection(newCards)); // TODO prevent overwriting list if not necessary return newCards; }
void updateTargetCards(SpellAbilityStackInstance si) { set( TrackableProperty.TargetCards, CardView.getCollection(si.getTargetChoices().getTargetCards())); }