| 1 | package com.takenoko.actions.tile; | |
| 2 | ||
| 3 | import com.takenoko.actions.ActionResult; | |
| 4 | import com.takenoko.actions.DefaultAction; | |
| 5 | import com.takenoko.actions.annotations.ActionAnnotation; | |
| 6 | import com.takenoko.actions.annotations.ActionType; | |
| 7 | import com.takenoko.engine.Board; | |
| 8 | import com.takenoko.engine.BotManager; | |
| 9 | import java.util.List; | |
| 10 | ||
| 11 | /** Action to draw a Tile from the deck. */ | |
| 12 | @ActionAnnotation(ActionType.DEFAULT) | |
| 13 | public class DrawTileAction implements DefaultAction { | |
| 14 | ||
| 15 | public static boolean canBePlayed(Board board) { | |
| 16 |
2
1. canBePlayed : replaced boolean return with true for com/takenoko/actions/tile/DrawTileAction::canBePlayed → TIMED_OUT 2. canBePlayed : negated conditional → KILLED |
return !board.isTileDeckEmpty(); |
| 17 | } | |
| 18 | ||
| 19 | @Override | |
| 20 | public ActionResult execute(Board board, BotManager botManager) { | |
| 21 |
1
1. execute : removed call to com/takenoko/engine/Board::drawTiles → KILLED |
board.drawTiles(); |
| 22 |
1
1. execute : removed call to com/takenoko/engine/BotManager::displayMessage → KILLED |
botManager.displayMessage(botManager.getName() + " drew tiles" + board.peekTileDeck()); |
| 23 |
1
1. execute : negated conditional → KILLED |
if (botManager.getInventory().hasImprovement()) { |
| 24 |
1
1. execute : replaced return value with null for com/takenoko/actions/tile/DrawTileAction::execute → KILLED |
return new ActionResult( |
| 25 | List.of(PlaceTileAction.class, PlaceTileWithImprovementAction.class), 0); | |
| 26 | } | |
| 27 |
1
1. execute : replaced return value with null for com/takenoko/actions/tile/DrawTileAction::execute → KILLED |
return new ActionResult(List.of(PlaceTileAction.class), 0); |
| 28 | } | |
| 29 | } | |
Mutations | ||
| 16 |
1.1 2.2 |
|
| 21 |
1.1 |
|
| 22 |
1.1 |
|
| 23 |
1.1 |
|
| 24 |
1.1 |
|
| 27 |
1.1 |