RedeemObjectiveAction.java

1
package com.takenoko.actions.objective;
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.ActionCanBePlayedMultipleTimesPerTurn;
7
import com.takenoko.actions.annotations.ActionType;
8
import com.takenoko.engine.Board;
9
import com.takenoko.engine.BotManager;
10
import com.takenoko.engine.BotState;
11
import com.takenoko.objective.Objective;
12
13
/** This class is an action to redeem an objective. */
14
@ActionAnnotation(ActionType.DEFAULT)
15
@ActionCanBePlayedMultipleTimesPerTurn()
16
public class RedeemObjectiveAction implements DefaultAction {
17
    final Objective objective;
18
19
    public RedeemObjectiveAction(Objective objective) {
20
        this.objective = objective;
21
    }
22
23
    public static boolean canBePlayed(BotState botState) {
24 2 1. canBePlayed : negated conditional → KILLED
2. canBePlayed : replaced boolean return with true for com/takenoko/actions/objective/RedeemObjectiveAction::canBePlayed → KILLED
        return !botState.getAchievedObjectives().isEmpty();
25
    }
26
27
    @Override
28
    public ActionResult execute(Board board, BotManager botManager) {
29 1 1. execute : removed call to com/takenoko/engine/BotManager::displayMessage → TIMED_OUT
        botManager.displayMessage(
30
                botManager.getName()
31
                        + " redeemed objective"
32
                        + objective
33
                        + " and gained "
34
                        + objective.getPoints()
35
                        + "points");
36 1 1. execute : removed call to com/takenoko/engine/BotManager::redeemObjective → KILLED
        botManager.redeemObjective(objective);
37 1 1. execute : removed call to com/takenoko/stats/SingleBotStatistics::updateObjectivesRedeemed → KILLED
        botManager.getSingleBotStatistics().updateObjectivesRedeemed(objective);
38 1 1. execute : replaced return value with null for com/takenoko/actions/objective/RedeemObjectiveAction::execute → KILLED
        return new ActionResult();
39
    }
40
}

Mutations

24

1.1
Location : canBePlayed
Killed by : com.takenoko.actions.objective.RedeemObjectiveActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.objective.RedeemObjectiveActionTest]/[nested-class:TestExecute]/[method:update_should_addRedeemObjectiveActionIfCanRedeemObjective()]
negated conditional → KILLED

2.2
Location : canBePlayed
Killed by : com.takenoko.engine.BotStateTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BotStateTest]/[nested-class:TestUpdateAvailableActions]/[method:updateAvailableActions_shouldNotRemoveAlreadyExecutedActionsIfWindy()]
replaced boolean return with true for com/takenoko/actions/objective/RedeemObjectiveAction::canBePlayed → KILLED

29

1.1
Location : execute
Killed by : none
removed call to com/takenoko/engine/BotManager::displayMessage → TIMED_OUT

36

1.1
Location : execute
Killed by : com.takenoko.actions.objective.RedeemObjectiveActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.objective.RedeemObjectiveActionTest]/[nested-class:TestExecute]/[method:execute_shouldReturnActionResultWithRedeemObjectiveAction()]
removed call to com/takenoko/engine/BotManager::redeemObjective → KILLED

37

1.1
Location : execute
Killed by : com.takenoko.actions.objective.RedeemObjectiveActionTest.[engine:junit-jupiter]/[class:com.takenoko.actions.objective.RedeemObjectiveActionTest]/[nested-class:TestExecute]/[method:shouldUpdateActionsInSingleBotStatistics()]
removed call to com/takenoko/stats/SingleBotStatistics::updateObjectivesRedeemed → KILLED

38

1.1
Location : execute
Killed by : com.takenoko.bot.utils.HistoryAnalysisTest.[engine:junit-jupiter]/[class:com.takenoko.bot.utils.HistoryAnalysisTest]/[nested-class:IntegrationTest]/[method:test1()]
replaced return value with null for com/takenoko/actions/objective/RedeemObjectiveAction::execute → KILLED

Active mutators

Tests examined


Report generated by PIT 1.8.0