Search in sources :

Example 1 with PlayableObjectStats

use of mage.players.PlayableObjectStats in project mage by magefree.

the class ReplayTask method prepareSelectableWindows.

private void prepareSelectableWindows(Collection<CardInfoWindowDialog> windows, Set<UUID> needSelectable, List<UUID> needChoosen, PlayableObjectsList needPlayable) {
    // so it must be updated manually (it's ok to keep outdated cards in dialog, but not ok to show wrong selections)
    for (CardInfoWindowDialog window : windows) {
        for (MageCard mageCard : window.getMageCardsForUpdate().values()) {
            CardView cardView = mageCard.getOriginal();
            cardView.setChoosable(needSelectable.contains(cardView.getId()));
            cardView.setSelected(needChoosen.contains(cardView.getId()));
            if (needPlayable.containsObject(cardView.getId())) {
                cardView.setPlayableStats(needPlayable.getStats(cardView.getId()));
            } else {
                cardView.setPlayableStats(new PlayableObjectStats());
            }
            // TODO: little bug with toggled night card after update/clicks, but that's ok (can't click on second side)
            mageCard.update(cardView);
        }
    }
}
Also used : PlayableObjectStats(mage.players.PlayableObjectStats) MageCard(mage.cards.MageCard)

Aggregations

MageCard (mage.cards.MageCard)1 PlayableObjectStats (mage.players.PlayableObjectStats)1