| 1 | package com.takenoko.bot.unitary; | |
| 2 | ||
| 3 | import com.takenoko.actions.irrigation.DrawIrrigationAction; | |
| 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 java.util.Objects; | |
| 9 | ||
| 10 | public class SmartDrawIrrigation extends PriorityBot { | |
| 11 | ||
| 12 | private final int maxIrrigationToChooseToDraw; | |
| 13 | ||
| 14 | public SmartDrawIrrigation(int maxIrrigationToChooseToDraw) { | |
| 15 | this.maxIrrigationToChooseToDraw = maxIrrigationToChooseToDraw; | |
| 16 | } | |
| 17 | ||
| 18 | @Override | |
| 19 | protected void fillAction(Board board, BotState botState, History history) { | |
| 20 |
2
1. fillAction : changed conditional boundary → TIMED_OUT 2. fillAction : negated conditional → KILLED |
if (botState.getInventory().getIrrigationChannelsCount() < maxIrrigationToChooseToDraw) { |
| 21 |
1
1. fillAction : removed call to com/takenoko/bot/unitary/SmartDrawIrrigation::addActionWithPriority → KILLED |
this.addActionWithPriority(new DrawIrrigationAction(), DEFAULT_PRIORITY); |
| 22 | } | |
| 23 | } | |
| 24 | ||
| 25 | @Override | |
| 26 | public boolean equals(Object o) { | |
| 27 |
2
1. equals : negated conditional → NO_COVERAGE 2. equals : replaced boolean return with false for com/takenoko/bot/unitary/SmartDrawIrrigation::equals → NO_COVERAGE |
if (this == o) return true; |
| 28 |
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/SmartDrawIrrigation::equals → NO_COVERAGE |
if (o == null || getClass() != o.getClass()) return false; |
| 29 |
2
1. equals : negated conditional → NO_COVERAGE 2. equals : replaced boolean return with true for com/takenoko/bot/unitary/SmartDrawIrrigation::equals → NO_COVERAGE |
if (!super.equals(o)) return false; |
| 30 | SmartDrawIrrigation that = (SmartDrawIrrigation) o; | |
| 31 |
2
1. equals : negated conditional → NO_COVERAGE 2. equals : replaced boolean return with true for com/takenoko/bot/unitary/SmartDrawIrrigation::equals → NO_COVERAGE |
return maxIrrigationToChooseToDraw == that.maxIrrigationToChooseToDraw; |
| 32 | } | |
| 33 | ||
| 34 | @Override | |
| 35 | public int hashCode() { | |
| 36 |
1
1. hashCode : replaced int return with 0 for com/takenoko/bot/unitary/SmartDrawIrrigation::hashCode → NO_COVERAGE |
return Objects.hash(super.hashCode(), maxIrrigationToChooseToDraw); |
| 37 | } | |
| 38 | } | |
Mutations | ||
| 20 |
1.1 2.2 |
|
| 21 |
1.1 |
|
| 27 |
1.1 2.2 |
|
| 28 |
1.1 2.2 3.3 |
|
| 29 |
1.1 2.2 |
|
| 31 |
1.1 2.2 |
|
| 36 |
1.1 |