| 1 | package com.takenoko.weather; | |
| 2 | ||
| 3 | import com.takenoko.actions.Action; | |
| 4 | import com.takenoko.actions.bamboo.GrowBambooAction; | |
| 5 | import com.takenoko.engine.Board; | |
| 6 | import com.takenoko.engine.BotManager; | |
| 7 | import java.util.List; | |
| 8 | ||
| 9 | /** | |
| 10 | * A fine rain nourishes the young bamboo shoots. The player may place a Bamboo section on the | |
| 11 | * irrigated plot of his choice, up to a limit of four sections per plot. | |
| 12 | */ | |
| 13 | public class Rainy extends Weather { | |
| 14 | @Override | |
| 15 | public List<Class<? extends Action>> apply(Board board, BotManager botManager) { | |
| 16 |
1
1. apply : removed call to com/takenoko/engine/Board::setWeather → TIMED_OUT |
board.setWeather(this); |
| 17 |
1
1. apply : negated conditional → KILLED |
if (board.getGrowablePositions().isEmpty()) { |
| 18 |
1
1. apply : removed call to com/takenoko/engine/BotManager::displayMessage → SURVIVED |
botManager.displayMessage("No bamboo to grow"); |
| 19 | return List.of(); | |
| 20 | } | |
| 21 |
1
1. apply : replaced return value with Collections.emptyList for com/takenoko/weather/Rainy::apply → KILLED |
return List.of(GrowBambooAction.class); |
| 22 | } | |
| 23 | ||
| 24 | @Override | |
| 25 | public void revert(Board board, BotManager botManager) { | |
| 26 |
1
1. revert : removed call to com/takenoko/engine/Board::resetWeather → TIMED_OUT |
board.resetWeather(); |
| 27 | } | |
| 28 | ||
| 29 | @Override | |
| 30 | public String toString() { | |
| 31 |
1
1. toString : replaced return value with "" for com/takenoko/weather/Rainy::toString → TIMED_OUT |
return "Rainy"; |
| 32 | } | |
| 33 | } | |
Mutations | ||
| 16 |
1.1 |
|
| 17 |
1.1 |
|
| 18 |
1.1 |
|
| 21 |
1.1 |
|
| 26 |
1.1 |
|
| 31 |
1.1 |