1 | package com.takenoko.bot.unitary; | |
2 | ||
3 | import com.takenoko.actions.weather.ChooseAndApplyWeatherAction; | |
4 | import com.takenoko.bot.PriorityBot; | |
5 | import com.takenoko.engine.Board; | |
6 | import com.takenoko.engine.BotState; | |
7 | import com.takenoko.engine.History; | |
8 | import com.takenoko.weather.Weather; | |
9 | import com.takenoko.weather.WeatherFactory; | |
10 | import java.util.Objects; | |
11 | ||
12 | public class SmartChooseAndApplyWeather extends PriorityBot { | |
13 | ||
14 | private final transient Weather weather; | |
15 | ||
16 | public SmartChooseAndApplyWeather(Weather weather) { | |
17 | this.weather = weather; | |
18 | } | |
19 | ||
20 | public SmartChooseAndApplyWeather() { | |
21 | this.weather = WeatherFactory.SUNNY.createWeather(); | |
22 | } | |
23 | ||
24 | @Override | |
25 | protected void fillAction(Board board, BotState botState, History history) { | |
26 |
3
1. lambda$fillAction$0 : replaced Boolean return with False for com/takenoko/bot/unitary/SmartChooseAndApplyWeather::lambda$fillAction$0 → TIMED_OUT 2. lambda$fillAction$0 : replaced Boolean return with True for com/takenoko/bot/unitary/SmartChooseAndApplyWeather::lambda$fillAction$0 → TIMED_OUT 3. fillAction : negated conditional → KILLED |
if (!board.getWeather().map(v -> v.getClass().equals(weather.getClass())).orElse(false)) { |
27 |
1
1. fillAction : removed call to com/takenoko/bot/unitary/SmartChooseAndApplyWeather::addActionWithPriority → KILLED |
this.addActionWithPriority(new ChooseAndApplyWeatherAction(weather), DEFAULT_PRIORITY); |
28 | } | |
29 | } | |
30 | ||
31 | @Override | |
32 | public boolean equals(Object o) { | |
33 |
2
1. equals : negated conditional → NO_COVERAGE 2. equals : replaced boolean return with false for com/takenoko/bot/unitary/SmartChooseAndApplyWeather::equals → NO_COVERAGE |
if (this == o) return true; |
34 |
3
1. equals : negated conditional → NO_COVERAGE 2. equals : negated conditional → NO_COVERAGE 3. equals : replaced boolean return with true for com/takenoko/bot/unitary/SmartChooseAndApplyWeather::equals → NO_COVERAGE |
if (o == null || getClass() != o.getClass()) return false; |
35 |
2
1. equals : negated conditional → NO_COVERAGE 2. equals : replaced boolean return with true for com/takenoko/bot/unitary/SmartChooseAndApplyWeather::equals → NO_COVERAGE |
if (!super.equals(o)) return false; |
36 | SmartChooseAndApplyWeather that = (SmartChooseAndApplyWeather) o; | |
37 |
2
1. equals : replaced boolean return with false for com/takenoko/bot/unitary/SmartChooseAndApplyWeather::equals → NO_COVERAGE 2. equals : replaced boolean return with true for com/takenoko/bot/unitary/SmartChooseAndApplyWeather::equals → NO_COVERAGE |
return Objects.equals(weather, that.weather); |
38 | } | |
39 | ||
40 | @Override | |
41 | public int hashCode() { | |
42 |
1
1. hashCode : replaced int return with 0 for com/takenoko/bot/unitary/SmartChooseAndApplyWeather::hashCode → NO_COVERAGE |
return Objects.hash(super.hashCode(), weather); |
43 | } | |
44 | } | |
Mutations | ||
26 |
1.1 2.2 3.3 |
|
27 |
1.1 |
|
33 |
1.1 2.2 |
|
34 |
1.1 2.2 3.3 |
|
35 |
1.1 2.2 |
|
37 |
1.1 2.2 |
|
42 |
1.1 |