mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +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())
|
||||
ManaSymbols.drawSymbol("phasing", g, cardXOffset + cardWidth / 2 - 16, cardYOffset + cardHeight - (cardHeight / 8) - 16);
|
||||
|
||||
Map<Counters,Integer> counters = getCard().getCounters();
|
||||
if (counters != null && !counters.isEmpty()) {
|
||||
if(counters.containsValue(1)) {
|
||||
ManaSymbols.drawSymbol("counters1", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||
} else if(counters.containsValue(2)) {
|
||||
ManaSymbols.drawSymbol("counters2", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||
} else if(counters.containsValue(3)) {
|
||||
ManaSymbols.drawSymbol("counters3", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||
} else {
|
||||
ManaSymbols.drawSymbol("countersMulti", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||
}
|
||||
int counters = getCard().getNumberOfCounters();
|
||||
|
||||
if(counters == 1) {
|
||||
ManaSymbols.drawSymbol("counters1", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||
} else if(counters == 2) {
|
||||
ManaSymbols.drawSymbol("counters2", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||
} else if(counters == 3) {
|
||||
ManaSymbols.drawSymbol("counters3", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||
} else if(counters > 3) {
|
||||
ManaSymbols.drawSymbol("countersMulti", g, cardXOffset + cardWidth - 65, cardYOffset + cardHeight - (cardHeight / 3) - 40);
|
||||
}
|
||||
|
||||
if (getCard() != null) {
|
||||
|
||||
@@ -1014,6 +1014,14 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
public final boolean hasCounters() {
|
||||
return counters.size() > 0;
|
||||
}
|
||||
|
||||
public final int getNumberOfCounters() {
|
||||
int number = 0;
|
||||
for(Integer i : counters.values()) {
|
||||
number += i.intValue();
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>setCounter.</p>
|
||||
|
||||
Reference in New Issue
Block a user