DrawTileAction.java

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
Location : canBePlayed
Killed by : com.takenoko.engine.BotStateTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BotStateTest]/[nested-class:TestUpdateAvailableActions]/[method:updateAvailableActions_shouldNotRemoveAlreadyExecutedActionsIfWindy()]
negated conditional → KILLED

2.2
Location : canBePlayed
Killed by : none
replaced boolean return with true for com/takenoko/actions/tile/DrawTileAction::canBePlayed → TIMED_OUT

21

1.1
Location : execute
Killed by : com.takenoko.actions.tile.DrawTileActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.tile.DrawTileActionTest]/[nested-class:TestExecute]/[method:testExecuteTileDeckNotEmptyAndInventoryDoesNotHaveImprovement()]
removed call to com/takenoko/engine/Board::drawTiles → KILLED

22

1.1
Location : execute
Killed by : com.takenoko.actions.tile.DrawTileActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.tile.DrawTileActionTest]/[nested-class:TestExecute]/[method:testExecuteTileDeckNotEmptyAndInventoryDoesNotHaveImprovement()]
removed call to com/takenoko/engine/BotManager::displayMessage → KILLED

23

1.1
Location : execute
Killed by : com.takenoko.actions.tile.DrawTileActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.tile.DrawTileActionTest]/[nested-class:TestExecute]/[method:testExecuteTileDeckNotEmptyAndInventoryDoesNotHaveImprovement()]
negated conditional → KILLED

24

1.1
Location : execute
Killed by : com.takenoko.actions.tile.DrawTileActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.tile.DrawTileActionTest]/[nested-class:TestExecute]/[method:testExecuteTileDeckNotEmptyAndInventoryHasImprovement()]
replaced return value with null for com/takenoko/actions/tile/DrawTileAction::execute → KILLED

27

1.1
Location : execute
Killed by : com.takenoko.actions.tile.DrawTileActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.tile.DrawTileActionTest]/[nested-class:TestExecute]/[method:testExecuteTileDeckNotEmptyAndInventoryDoesNotHaveImprovement()]
replaced return value with null for com/takenoko/actions/tile/DrawTileAction::execute → KILLED

Active mutators

Tests examined


Report generated by PIT 1.8.0