Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix task prioritization bug #4

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/codingame/game/CommandManager.java
Expand Up @@ -235,7 +235,7 @@ public void parseCommand(Player player, String command, Game game, GamePhase gam
}
CardType cardType = CardType.values()[cardTypeToThrow];
int cardsCount = (int)player.getCardsInHand().stream().filter(c -> c.getCardType().equals(cardType)).count();
if (cardsCount==0 || (cardsCount==1 && cardType.equals(CardType.CONTINUOUS_INTEGRATION))) {
if (cardsCount==0 || (cardsCount==1 && cardType.equals(CardType.TASK_PRIORITIZATION))) {
throw new GameRuleException(command, String.format("you do not have a card of type %s to deprioritize", cardType));
}
int cardTypeToTake = Integer.parseInt(match.group("cardTypeToTake"));
Expand Down