| 1 | package com.takenoko.actions.irrigation; | |
| 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 | @ActionAnnotation(ActionType.DEFAULT) | |
| 12 | public class DrawIrrigationAction implements DefaultAction { | |
| 13 | ||
| 14 | public static boolean canBePlayed(Board board) { | |
| 15 |
2
1. canBePlayed : replaced boolean return with false for com/takenoko/actions/irrigation/DrawIrrigationAction::canBePlayed → TIMED_OUT 2. canBePlayed : replaced boolean return with true for com/takenoko/actions/irrigation/DrawIrrigationAction::canBePlayed → KILLED |
return board.hasIrrigation(); |
| 16 | } | |
| 17 | ||
| 18 | @Override | |
| 19 | public ActionResult execute(Board board, BotManager botManager) { | |
| 20 |
1
1. execute : removed call to com/takenoko/engine/BotManager::displayMessage → TIMED_OUT |
botManager.displayMessage(botManager.getName() + " drew irrigation"); |
| 21 |
1
1. execute : removed call to com/takenoko/engine/Board::drawIrrigation → TIMED_OUT |
board.drawIrrigation(); |
| 22 |
1
1. execute : removed call to com/takenoko/inventory/Inventory::collectIrrigationChannel → TIMED_OUT |
botManager.getInventory().collectIrrigationChannel(); |
| 23 |
1
1. execute : negated conditional → TIMED_OUT |
if (!board.getAvailableIrrigationPositions().isEmpty()) { |
| 24 |
1
1. execute : replaced return value with null for com/takenoko/actions/irrigation/DrawIrrigationAction::execute → KILLED |
return new ActionResult( |
| 25 | List.of(PlaceIrrigationAction.class, StoreIrrigationInInventoryAction.class), | |
| 26 | 0); | |
| 27 | } | |
| 28 |
1
1. execute : replaced return value with null for com/takenoko/actions/irrigation/DrawIrrigationAction::execute → KILLED |
return new ActionResult(List.of(StoreIrrigationInInventoryAction.class), 0); |
| 29 | } | |
| 30 | ||
| 31 | @Override | |
| 32 | public boolean equals(Object o) { | |
| 33 |
2
1. equals : replaced boolean return with true for com/takenoko/actions/irrigation/DrawIrrigationAction::equals → SURVIVED 2. equals : replaced boolean return with false for com/takenoko/actions/irrigation/DrawIrrigationAction::equals → KILLED |
return o instanceof DrawIrrigationAction; |
| 34 | } | |
| 35 | ||
| 36 | @Override | |
| 37 | public int hashCode() { | |
| 38 |
1
1. hashCode : replaced int return with 0 for com/takenoko/actions/irrigation/DrawIrrigationAction::hashCode → TIMED_OUT |
return this.getClass().hashCode(); |
| 39 | } | |
| 40 | } | |
Mutations | ||
| 15 |
1.1 2.2 |
|
| 20 |
1.1 |
|
| 21 |
1.1 |
|
| 22 |
1.1 |
|
| 23 |
1.1 |
|
| 24 |
1.1 |
|
| 28 |
1.1 |
|
| 33 |
1.1 2.2 |
|
| 38 |
1.1 |