mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Code cleanup
This commit is contained in:
@@ -28,25 +28,30 @@ public final class InputProliferate extends InputSelectManyBase<GameEntity> {
|
||||
protected String getMessage() {
|
||||
StringBuilder sb = new StringBuilder("Choose permanents and/or players with counters on them to add one more counter of that type.");
|
||||
sb.append("\n\nYou've selected so far:\n");
|
||||
if( selected.isEmpty())
|
||||
if (selected.isEmpty()) {
|
||||
sb.append("(none)");
|
||||
else
|
||||
for(GameEntity ge : selected ) {
|
||||
if( ge instanceof Player )
|
||||
}
|
||||
else {
|
||||
for (GameEntity ge : selected) {
|
||||
if (ge instanceof Player) {
|
||||
sb.append("* A poison counter to player ").append(ge).append("\n");
|
||||
else
|
||||
}
|
||||
else {
|
||||
sb.append("* ").append(ge).append(" -> ").append(chosenCounters.get(ge)).append("counter\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCardSelected(final Card card, final MouseEvent triggerEvent) {
|
||||
if( !selectEntity(card) )
|
||||
if (!selectEntity(card)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( selected.contains(card) ) {
|
||||
if (selected.contains(card)) {
|
||||
final List<CounterType> choices = new ArrayList<CounterType>();
|
||||
for (final CounterType ct : CounterType.values()) {
|
||||
if (card.getCounters(ct) > 0) {
|
||||
@@ -63,18 +68,21 @@ public final class InputProliferate extends InputSelectManyBase<GameEntity> {
|
||||
|
||||
@Override
|
||||
public void selectPlayer(final Player player) {
|
||||
if( !selectEntity(player) )
|
||||
if (!selectEntity(player)) {
|
||||
return;
|
||||
}
|
||||
refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isValidChoice(GameEntity choice) {
|
||||
if (choice instanceof Player)
|
||||
if (choice instanceof Player) {
|
||||
return ((Player) choice).getPoisonCounters() > 0 && !choice.hasKeyword("You can't get poison counters");
|
||||
}
|
||||
|
||||
if (choice instanceof Card)
|
||||
if (choice instanceof Card) {
|
||||
return ((Card) choice).hasCounters();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user