use of mage.abilities.icon.CardIcon in project mage by magefree.
the class ClassReminderAbility method getIcons.
@Override
public List<CardIcon> getIcons(Game game) {
if (game == null) {
return this.icons;
}
// dynamic GUI icon with current level
List<CardIcon> res = new ArrayList<>();
Permanent permanent = this.getSourcePermanentOrLKI(game);
if (permanent == null) {
return res;
}
CardIcon levelIcon = new CardIconImpl(CardIconType.ABILITY_CLASS_LEVEL, "Current class level: " + permanent.getClassLevel(), String.valueOf(permanent.getClassLevel()));
res.add(levelIcon);
return res;
}
use of mage.abilities.icon.CardIcon in project mage by magefree.
the class MageLayer method updateCardIcons.
private void updateCardIcons(CardView card) {
Map<CardIconsPanel, List<CardIcon>> newIcons = new HashMap<>();
this.iconsPanels.forEach(panel -> newIcons.put(panel, new ArrayList<>()));
List<CardIcon> allIcons = new ArrayList<>();
// main icons
allIcons.addAll(card.getCardIcons());
// playable icons
if (card.getPlayableStats().getPlayableImportantAmount() > 0) {
allIcons.add(new PlayableCountIcon(card.getPlayableStats()));
}
// create panels
allIcons.forEach(cardIcon -> {
CardIconCategory category = cardIcon.getIconType().getCategory();
// debug panel must take all icons (position depends on render settings)
if (iconsDebugPanel != null) {
newIcons.get(iconsDebugPanel).add(cardIcon);
}
// playable panel (bottom left corner)
if (iconsPlayablePanel != null && category == CardIconCategory.PLAYABLE_COUNT) {
newIcons.get(iconsPlayablePanel).add(cardIcon);
}
// abilities panel (left side)
if (iconsAbilitiesPanel != null && category == CardIconCategory.ABILITY) {
newIcons.get(iconsAbilitiesPanel).add(cardIcon);
}
// commander panel (top center)
if (iconsCommanderPanel != null && category == CardIconCategory.COMMANDER) {
newIcons.get(iconsCommanderPanel).add(cardIcon);
}
});
this.iconsPanels.forEach(panel -> panel.updateIcons(newIcons.get(panel)));
}
Aggregations