Cleaning up
This commit is contained in:
@@ -277,15 +277,12 @@ public class CardResolver {
|
|||||||
public boolean isPlayableInFull(ActionContext actionContext) {
|
public boolean isPlayableInFull(ActionContext actionContext) {
|
||||||
int min = countSource.getMinimum(actionContext);
|
int min = countSource.getMinimum(actionContext);
|
||||||
|
|
||||||
Filterable filterable = Filters.any;
|
|
||||||
if (choiceFilter != null)
|
|
||||||
filterable = choiceFilter.getFilterable(actionContext);
|
|
||||||
Filterable additionalFilterable = Filters.any;
|
Filterable additionalFilterable = Filters.any;
|
||||||
if (playabilityFilter != null)
|
if (playabilityFilter != null)
|
||||||
additionalFilterable = playabilityFilter.getFilterable(actionContext);
|
additionalFilterable = playabilityFilter.getFilterable(actionContext);
|
||||||
|
|
||||||
Set<PhysicalCard> self = Collections.singleton(actionContext.getSource());
|
Set<PhysicalCard> self = Collections.singleton(actionContext.getSource());
|
||||||
return Filters.filter(self, actionContext.getGame(), Filters.zone(Zone.DISCARD), filterable, additionalFilterable).size() >= min;
|
return Filters.filter(self, actionContext.getGame(), Filters.zone(Zone.DISCARD), additionalFilterable).size() >= min;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -311,14 +308,11 @@ public class CardResolver {
|
|||||||
int min = countSource.getMinimum(null);
|
int min = countSource.getMinimum(null);
|
||||||
String choicePlayerId = playerSource.getPlayer(actionContext);
|
String choicePlayerId = playerSource.getPlayer(actionContext);
|
||||||
final Collection<? extends PhysicalCard> cardsFromMemory = actionContext.getCardsFromMemory(sourceMemory);
|
final Collection<? extends PhysicalCard> cardsFromMemory = actionContext.getCardsFromMemory(sourceMemory);
|
||||||
Filterable filterable = Filters.any;
|
|
||||||
if (choiceFilter != null)
|
|
||||||
filterable = choiceFilter.getFilterable(actionContext);
|
|
||||||
Filterable additionalFilterable = Filters.any;
|
Filterable additionalFilterable = Filters.any;
|
||||||
if (playabilityFilter != null)
|
if (playabilityFilter != null)
|
||||||
additionalFilterable = playabilityFilter.getFilterable(actionContext);
|
additionalFilterable = playabilityFilter.getFilterable(actionContext);
|
||||||
final LotroGame game = actionContext.getGame();
|
final LotroGame game = actionContext.getGame();
|
||||||
return Filters.filter(game.getGameState().getDiscard(choicePlayerId), game, Filters.in(cardsFromMemory), filterable, additionalFilterable).size() >= min;
|
return Filters.filter(game.getGameState().getDiscard(choicePlayerId), game, Filters.in(cardsFromMemory), additionalFilterable).size() >= min;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -336,6 +330,11 @@ public class CardResolver {
|
|||||||
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter, environment);
|
||||||
final PlayerSource playerSource = PlayerResolver.resolvePlayer(choicePlayer, environment);
|
final PlayerSource playerSource = PlayerResolver.resolvePlayer(choicePlayer, environment);
|
||||||
return new DelayedAppender() {
|
return new DelayedAppender() {
|
||||||
|
@Override
|
||||||
|
public boolean isPlayableInFull(ActionContext actionContext) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
protected Effect createEffect(boolean cost, CostToEffectAction action, ActionContext actionContext) {
|
||||||
return new UnrespondableEffect() {
|
return new UnrespondableEffect() {
|
||||||
@@ -346,18 +345,10 @@ public class CardResolver {
|
|||||||
Filterable filterable = Filters.any;
|
Filterable filterable = Filters.any;
|
||||||
if (choiceFilter != null)
|
if (choiceFilter != null)
|
||||||
filterable = choiceFilter.getFilterable(actionContext);
|
filterable = choiceFilter.getFilterable(actionContext);
|
||||||
Filterable additionalFilterable = Filters.any;
|
actionContext.setCardMemory(memory, Filters.filter(game.getGameState().getDiscard(choicePlayerId), game, filter, filterable));
|
||||||
if (playabilityFilter != null)
|
|
||||||
additionalFilterable = playabilityFilter.getFilterable(actionContext);
|
|
||||||
actionContext.setCardMemory(memory, Filters.filter(game.getGameState().getDiscard(choicePlayerId), game, filter, filterable, additionalFilterable));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isPlayableInFull(ActionContext actionContext) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
} else if (type.startsWith("choose(") && type.endsWith(")")) {
|
} else if (type.startsWith("choose(") && type.endsWith(")")) {
|
||||||
final String filter = type.substring(type.indexOf("(") + 1, type.lastIndexOf(")"));
|
final String filter = type.substring(type.indexOf("(") + 1, type.lastIndexOf(")"));
|
||||||
@@ -369,14 +360,11 @@ public class CardResolver {
|
|||||||
int min = countSource.getMinimum(actionContext);
|
int min = countSource.getMinimum(actionContext);
|
||||||
final Filterable filter = filterableSource.getFilterable(actionContext);
|
final Filterable filter = filterableSource.getFilterable(actionContext);
|
||||||
String choicePlayerId = playerSource.getPlayer(actionContext);
|
String choicePlayerId = playerSource.getPlayer(actionContext);
|
||||||
Filterable filterable = Filters.any;
|
|
||||||
if (choiceFilter != null)
|
|
||||||
filterable = choiceFilter.getFilterable(actionContext);
|
|
||||||
Filterable additionalFilterable = Filters.any;
|
Filterable additionalFilterable = Filters.any;
|
||||||
if (playabilityFilter != null)
|
if (playabilityFilter != null)
|
||||||
additionalFilterable = playabilityFilter.getFilterable(actionContext);
|
additionalFilterable = playabilityFilter.getFilterable(actionContext);
|
||||||
final LotroGame game = actionContext.getGame();
|
final LotroGame game = actionContext.getGame();
|
||||||
return Filters.filter(game.getGameState().getDiscard(choicePlayerId), game, filter, filterable, additionalFilterable).size() >= min;
|
return Filters.filter(game.getGameState().getDiscard(choicePlayerId), game, filter, additionalFilterable).size() >= min;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user