1 | package com.takenoko.actions.weather; | |
2 | ||
3 | import com.takenoko.actions.Action; | |
4 | import com.takenoko.actions.ActionResult; | |
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 com.takenoko.weather.Weather; | |
10 | import java.util.Objects; | |
11 | ||
12 | /** Action to choose a weather and apply it. */ | |
13 | @ActionAnnotation(ActionType.FORCED) | |
14 | public class ChooseAndApplyWeatherAction implements Action { | |
15 | final Weather weather; | |
16 | ||
17 | public ChooseAndApplyWeatherAction(Weather weather) { | |
18 | this.weather = weather; | |
19 | } | |
20 | ||
21 | @Override | |
22 | public ActionResult execute(Board board, BotManager botManager) { | |
23 |
1
1. execute : removed call to com/takenoko/engine/BotManager::displayMessage → TIMED_OUT |
botManager.displayMessage(botManager.getName() + " chose and applied weather " + weather); |
24 |
1
1. execute : removed call to com/takenoko/stats/SingleBotStatistics::updateWeathersApplied → TIMED_OUT |
botManager.getSingleBotStatistics().updateWeathersApplied(weather.toString()); |
25 |
1
1. execute : replaced return value with null for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::execute → KILLED |
return new ActionResult(weather.apply(board, botManager), 0); |
26 | } | |
27 | ||
28 | @Override | |
29 | public boolean equals(Object o) { | |
30 |
2
1. equals : negated conditional → SURVIVED 2. equals : replaced boolean return with false for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → NO_COVERAGE |
if (this == o) return true; |
31 |
3
1. equals : replaced boolean return with true for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → NO_COVERAGE 2. equals : negated conditional → KILLED 3. equals : negated conditional → KILLED |
if (o == null || getClass() != o.getClass()) return false; |
32 | ChooseAndApplyWeatherAction that = (ChooseAndApplyWeatherAction) o; | |
33 |
2
1. equals : replaced boolean return with true for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → SURVIVED 2. equals : replaced boolean return with false for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::equals → KILLED |
return Objects.equals(weather, that.weather); |
34 | } | |
35 | ||
36 | @Override | |
37 | public int hashCode() { | |
38 |
1
1. hashCode : replaced int return with 0 for com/takenoko/actions/weather/ChooseAndApplyWeatherAction::hashCode → TIMED_OUT |
return Objects.hash(weather); |
39 | } | |
40 | } | |
Mutations | ||
23 |
1.1 |
|
24 |
1.1 |
|
25 |
1.1 |
|
30 |
1.1 2.2 |
|
31 |
1.1 2.2 3.3 |
|
33 |
1.1 2.2 |
|
38 |
1.1 |