mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- The number of counters shown on a card is now based on the sum of all counters.
This commit is contained in:
@@ -289,17 +289,16 @@ public class CardPanel extends JPanel implements CardContainer {
|
|||||||
if (getCard().isPhasedOut())
|
if (getCard().isPhasedOut())
|
||||||
ManaSymbols.drawSymbol("phasing", g, cardXOffset + cardWidth / 2 - 16, cardYOffset + cardHeight - (cardHeight / 8) - 16);
|
ManaSymbols.drawSymbol("phasing", g, cardXOffset + cardWidth / 2 - 16, cardYOffset + cardHeight - (cardHeight / 8) - 16);
|
||||||
|
|
||||||
Map<Counters,Integer> counters = getCard().getCounters();
|
int counters = getCard().getNumberOfCounters();
|
||||||
if (counters != null && !counters.isEmpty()) {
|
|
||||||
if(counters.containsValue(1)) {
|
if(counters == 1) {
|
||||||
ManaSymbols.drawSymbol("counters1", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
ManaSymbols.drawSymbol("counters1", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||||
} else if(counters.containsValue(2)) {
|
} else if(counters == 2) {
|
||||||
ManaSymbols.drawSymbol("counters2", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
ManaSymbols.drawSymbol("counters2", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||||
} else if(counters.containsValue(3)) {
|
} else if(counters == 3) {
|
||||||
ManaSymbols.drawSymbol("counters3", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
ManaSymbols.drawSymbol("counters3", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||||
} else {
|
} else if(counters > 3) {
|
||||||
ManaSymbols.drawSymbol("countersMulti", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
ManaSymbols.drawSymbol("countersMulti", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getCard() != null) {
|
if (getCard() != null) {
|
||||||
|
|||||||
@@ -1014,6 +1014,14 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
public final boolean hasCounters() {
|
public final boolean hasCounters() {
|
||||||
return counters.size() > 0;
|
return counters.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final int getNumberOfCounters() {
|
||||||
|
int number = 0;
|
||||||
|
for(Integer i : counters.values()) {
|
||||||
|
number += i.intValue();
|
||||||
|
}
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>setCounter.</p>
|
* <p>setCounter.</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user