Board.java

1
package com.takenoko.engine;
2
3
import com.takenoko.actors.Gardener;
4
import com.takenoko.actors.Panda;
5
import com.takenoko.asset.GameAssets;
6
import com.takenoko.layers.bamboo.BambooLayer;
7
import com.takenoko.layers.bamboo.LayerBambooStack;
8
import com.takenoko.layers.irrigation.EdgePosition;
9
import com.takenoko.layers.irrigation.IrrigationLayer;
10
import com.takenoko.layers.tile.ImprovementType;
11
import com.takenoko.layers.tile.Tile;
12
import com.takenoko.layers.tile.TileLayer;
13
import com.takenoko.objective.Objective;
14
import com.takenoko.objective.ObjectiveType;
15
import com.takenoko.stats.BoardStatistics;
16
import com.takenoko.vector.PositionVector;
17
import com.takenoko.weather.Weather;
18
import java.util.*;
19
20
/** Board class. The board contains the tiles. */
21
public class Board {
22
    private final TileLayer tileLayer;
23
    private final BambooLayer bambooLayer;
24
    private final IrrigationLayer irrigationLayer;
25
    private final Panda panda;
26
    private final Gardener gardener;
27
    private final GameAssets gameAssets;
28
    private Weather weather = null;
29
    int roundNumber = 0;
30
    private final BoardStatistics boardStatistics;
31
32
    /**
33
     * Constructor for the Board class.
34
     *
35
     * @param tileLayer the tile layer
36
     * @param bambooLayer the bamboo layer
37
     * @param panda the panda
38
     * @param gardener the gardener
39
     * @param gameAssets the game assets : dice
40
     * @param irrigationLayer the irrigation layer
41
     */
42
    public Board(
43
            TileLayer tileLayer,
44
            BambooLayer bambooLayer,
45
            Panda panda,
46
            Gardener gardener,
47
            GameAssets gameAssets,
48
            IrrigationLayer irrigationLayer,
49
            BoardStatistics boardStatistics) {
50
        this.tileLayer = tileLayer;
51
        this.bambooLayer = bambooLayer;
52
        this.panda = panda;
53
        this.gardener = gardener;
54
        this.gameAssets = gameAssets;
55
        this.irrigationLayer = irrigationLayer;
56
        this.boardStatistics = boardStatistics;
57
    }
58
59
    public void rollWeather() {
60
        gameAssets.getWeatherDice().rollWeather();
61
    }
62
63
    public Weather peekWeather() {
64 1 1. peekWeather : replaced return value with null for com/takenoko/engine/Board::peekWeather → KILLED
        return gameAssets.getWeatherDice().peekWeather();
65
    }
66
67
    /** Constructor for the Board class. */
68
    public Board() {
69
        this(
70
                new TileLayer(),
71
                new BambooLayer(),
72
                new Panda(),
73
                new Gardener(),
74
                new GameAssets(),
75
                new IrrigationLayer(),
76
                new BoardStatistics());
77
    }
78
79
    public Board(Board board) {
80
        this.tileLayer = board.tileLayer.copy();
81
        this.bambooLayer = board.bambooLayer.copy();
82
        this.panda = board.panda.copy();
83
        this.gardener = board.gardener.copy();
84
        this.gameAssets = board.gameAssets.copy();
85
        this.weather = board.weather;
86
        this.irrigationLayer = board.irrigationLayer.copy();
87
        this.roundNumber = board.roundNumber;
88
        this.boardStatistics = board.boardStatistics;
89
    }
90
91
    /**
92
     * Return the list of available tiles.
93
     *
94
     * @return the list of available tiles
95
     */
96
    public List<Tile> getAvailableTiles() {
97 1 1. getAvailableTiles : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getAvailableTiles → KILLED
        return tileLayer.getAvailableTiles();
98
    }
99
100
    /**
101
     * Returns a copy of the hashmap of tiles.
102
     *
103
     * @return the map of tiles
104
     */
105
    public Map<PositionVector, Tile> getTiles() {
106 1 1. getTiles : replaced return value with Collections.emptyMap for com/takenoko/engine/Board::getTiles → KILLED
        return new HashMap<>(tileLayer.getTiles());
107
    }
108
109
    /**
110
     * Returns the available tile positions.
111
     *
112
     * @return the available tile positions
113
     */
114
    public List<PositionVector> getAvailableTilePositions() {
115 1 1. getAvailableTilePositions : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getAvailableTilePositions → KILLED
        return tileLayer.getAvailableTilePositions();
116
    }
117
118
    /**
119
     * Returns a copy of the hashmap of tiles without the pond.
120
     *
121
     * @return the map of tiles without the pond
122
     */
123
    public Map<PositionVector, Tile> getTilesWithoutPond() {
124 1 1. getTilesWithoutPond : replaced return value with Collections.emptyMap for com/takenoko/engine/Board::getTilesWithoutPond → KILLED
        return new HashMap<>(tileLayer.getTilesWithoutPond());
125
    }
126
127
    /**
128
     * Returns if the position is a tile.
129
     *
130
     * @param positionVector the position of the tile
131
     * @return if there is a tile at the position
132
     */
133
    public boolean isTile(PositionVector positionVector) {
134 2 1. isTile : replaced boolean return with false for com/takenoko/engine/Board::isTile → KILLED
2. isTile : replaced boolean return with true for com/takenoko/engine/Board::isTile → KILLED
        return tileLayer.isTile(positionVector);
135
    }
136
137
    /**
138
     * Returns the tile at the position.
139
     *
140
     * @param positionVector the position of the tile
141
     * @return the tile at the position
142
     */
143
    public Tile getTileAt(PositionVector positionVector) {
144 1 1. getTileAt : replaced return value with null for com/takenoko/engine/Board::getTileAt → KILLED
        return tileLayer.getTileAt(positionVector);
145
    }
146
147
    /**
148
     * Place a tile on the board. and update the available tiles and the available tile positions.
149
     *
150
     * @param tile the tile to add to the board
151
     * @param position the position of the tile
152
     * @return the LayerBambooStack at the position of the tile
153
     */
154
    public LayerBambooStack placeTile(Tile tile, PositionVector position) {
155 1 1. placeTile : replaced return value with null for com/takenoko/engine/Board::placeTile → KILLED
        return tileLayer.placeTile(tile, position, this);
156
    }
157
158
    /**
159
     * Get the bamboo stack at the position.
160
     *
161
     * @param positionVector the position of the tile
162
     */
163
    public LayerBambooStack getBambooAt(PositionVector positionVector) {
164 1 1. getBambooAt : replaced return value with null for com/takenoko/engine/Board::getBambooAt → KILLED
        return bambooLayer.getBambooAt(positionVector, this);
165
    }
166
167
    /**
168
     * Grow bamboo on a tile. By default, the number of bamboo is 1 if the tile is irrigated.
169
     *
170
     * @param positionVector the position of the tile
171
     * @return the bamboo stack at the position
172
     */
173
    public LayerBambooStack growBamboo(PositionVector positionVector) {
174 1 1. growBamboo : replaced return value with null for com/takenoko/engine/Board::growBamboo → KILLED
        return bambooLayer.growBamboo(positionVector, this);
175
    }
176
177
    /**
178
     * Eat a bamboo from a tile.
179
     *
180
     * @param positionVector the position of the tile
181
     */
182
    public void eatBamboo(PositionVector positionVector) {
183 1 1. eatBamboo : removed call to com/takenoko/layers/bamboo/BambooLayer::eatBamboo → KILLED
        bambooLayer.eatBamboo(positionVector, this);
184
    }
185
186
    /**
187
     * Check if the bamboo at the position is eatable.
188
     *
189
     * @param positionVector the position of the tile
190
     * @return if the bamboo at the position is eatable
191
     */
192
    public boolean isBambooEatableAt(PositionVector positionVector) {
193 2 1. isBambooEatableAt : replaced boolean return with false for com/takenoko/engine/Board::isBambooEatableAt → TIMED_OUT
2. isBambooEatableAt : replaced boolean return with true for com/takenoko/engine/Board::isBambooEatableAt → KILLED
        return bambooLayer.isEatableAt(positionVector, this);
194
    }
195
196
    /** Get the Position of the Panda */
197
    public PositionVector getPandaPosition() {
198 1 1. getPandaPosition : replaced return value with null for com/takenoko/engine/Board::getPandaPosition → KILLED
        return panda.getPosition();
199
    }
200
201
    /** Get the Position of the Gardener */
202
    public PositionVector getGardenerPosition() {
203 1 1. getGardenerPosition : replaced return value with null for com/takenoko/engine/Board::getGardenerPosition → KILLED
        return gardener.getPosition();
204
    }
205
206
    /**
207
     * Returns possible moves for the panda.
208
     *
209
     * @return the possible moves
210
     */
211
    public List<PositionVector> getPandaPossibleMoves() {
212 1 1. getPandaPossibleMoves : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getPandaPossibleMoves → KILLED
        return panda.getPossibleMoves(this);
213
    }
214
215
    /**
216
     * Returns possible moves for the gardener.
217
     *
218
     * @return the possible moves
219
     */
220
    public List<PositionVector> getGardenerPossibleMoves() {
221 1 1. getGardenerPossibleMoves : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getGardenerPossibleMoves → KILLED
        return gardener.getPossibleMoves(this);
222
    }
223
224
    /**
225
     * Move the panda with a vector.
226
     *
227
     * @param vector the vector to move the panda
228
     * @return bamboo stack of one if the panda ate bamboo
229
     */
230
    public Map<PositionVector, LayerBambooStack> movePanda(PositionVector vector) {
231 1 1. movePanda : replaced return value with Collections.emptyMap for com/takenoko/engine/Board::movePanda → KILLED
        return panda.move(vector, this);
232
    }
233
234
    /**
235
     * Move the gardener with a vector.
236
     *
237
     * @param vector the vector to move the gardener
238
     * @return bamboo stack of one if the gardener planted bamboo
239
     */
240
    public Map<PositionVector, LayerBambooStack> moveGardener(PositionVector vector) {
241 1 1. moveGardener : replaced return value with Collections.emptyMap for com/takenoko/engine/Board::moveGardener → TIMED_OUT
        return gardener.move(vector, this);
242
    }
243
244
    @Override
245
    public boolean equals(Object o) {
246 2 1. equals : negated conditional → KILLED
2. equals : replaced boolean return with false for com/takenoko/engine/Board::equals → KILLED
        if (this == o) return true;
247 3 1. equals : negated conditional → KILLED
2. equals : negated conditional → KILLED
3. equals : replaced boolean return with true for com/takenoko/engine/Board::equals → KILLED
        if (o == null || getClass() != o.getClass()) return false;
248
        Board board = (Board) o;
249 2 1. equals : negated conditional → KILLED
2. equals : replaced boolean return with true for com/takenoko/engine/Board::equals → KILLED
        return tileLayer.equals(board.tileLayer)
250 1 1. equals : negated conditional → KILLED
                && bambooLayer.equals(board.bambooLayer)
251 1 1. equals : negated conditional → KILLED
                && panda.equals(board.panda)
252 1 1. equals : negated conditional → KILLED
                && gardener.equals((board.gardener))
253 1 1. equals : negated conditional → KILLED
                && gameAssets.equals(board.gameAssets)
254 1 1. equals : negated conditional → KILLED
                && Objects.equals(weather, board.weather)
255 3 1. equals : negated conditional → KILLED
2. equals : negated conditional → KILLED
3. equals : negated conditional → KILLED
                && irrigationLayer.equals(board.irrigationLayer)
256
                && roundNumber == board.roundNumber
257
                && boardStatistics == board.boardStatistics;
258
    }
259
260
    @Override
261
    public int hashCode() {
262 1 1. hashCode : replaced int return with 0 for com/takenoko/engine/Board::hashCode → KILLED
        return Objects.hash(
263
                tileLayer,
264
                bambooLayer,
265
                panda,
266
                gardener,
267
                gameAssets,
268
                weather,
269
                irrigationLayer,
270
                roundNumber,
271
                boardStatistics);
272
    }
273
274
    public Board copy() {
275 1 1. copy : replaced return value with null for com/takenoko/engine/Board::copy → KILLED
        return new Board(this);
276
    }
277
278
    public Optional<Weather> getWeather() {
279 1 1. getWeather : replaced return value with Optional.empty for com/takenoko/engine/Board::getWeather → TIMED_OUT
        return Optional.ofNullable(weather);
280
    }
281
282
    public void setWeather(Weather weather) {
283
        this.weather = weather;
284
    }
285
286
    /** Changes the weather to null. This is used when the weather is over. */
287
    public void resetWeather() {
288
        weather = null;
289
    }
290
291
    public boolean isBambooGrowableAt(PositionVector positionVector) {
292 2 1. isBambooGrowableAt : replaced boolean return with true for com/takenoko/engine/Board::isBambooGrowableAt → TIMED_OUT
2. isBambooGrowableAt : replaced boolean return with false for com/takenoko/engine/Board::isBambooGrowableAt → KILLED
        return bambooLayer.isGrowableAt(positionVector, this);
293
    }
294
295
    /**
296
     * @param improvementType the type of improvement
297
     * @return the improvement of the type
298
     */
299
    public ImprovementType drawImprovement(ImprovementType improvementType) {
300 1 1. drawImprovement : replaced return value with null for com/takenoko/engine/Board::drawImprovement → TIMED_OUT
        return gameAssets.getImprovementDeck().draw(improvementType);
301
    }
302
303
    /**
304
     * Returns last improvement drawn.
305
     *
306
     * @return the last improvement drawn
307
     */
308
    public ImprovementType peekImprovement() {
309 1 1. peekImprovement : replaced return value with null for com/takenoko/engine/Board::peekImprovement → TIMED_OUT
        return gameAssets.getImprovementDeck().peek();
310
    }
311
312
    /**
313
     * @param improvementType the type of improvement
314
     * @return if the improvement is available
315
     */
316
    public boolean hasImprovementInDeck(ImprovementType improvementType) {
317 2 1. hasImprovementInDeck : replaced boolean return with false for com/takenoko/engine/Board::hasImprovementInDeck → TIMED_OUT
2. hasImprovementInDeck : replaced boolean return with true for com/takenoko/engine/Board::hasImprovementInDeck → TIMED_OUT
        return gameAssets.getImprovementDeck().hasImprovement(improvementType);
318
    }
319
320
    public List<PositionVector> getAvailableImprovementPositions() {
321 1 1. getAvailableImprovementPositions : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getAvailableImprovementPositions → TIMED_OUT
        return tileLayer.getAvailableImprovementPositions(this);
322
    }
323
324
    public void drawTiles() {
325 1 1. drawTiles : removed call to com/takenoko/asset/TileDeck::draw → KILLED
        gameAssets.getTileDeck().draw();
326
    }
327
328
    public List<Tile> peekTileDeck() {
329 1 1. peekTileDeck : replaced return value with Collections.emptyList for com/takenoko/engine/Board::peekTileDeck → KILLED
        return gameAssets.getTileDeck().peek();
330
    }
331
332
    public void chooseTileInTileDeck(Tile tile) {
333 1 1. chooseTileInTileDeck : removed call to com/takenoko/asset/TileDeck::choose → TIMED_OUT
        gameAssets.getTileDeck().choose(tile);
334
    }
335
336
    public boolean isTileDeckEmpty() {
337 2 1. isTileDeckEmpty : replaced boolean return with false for com/takenoko/engine/Board::isTileDeckEmpty → TIMED_OUT
2. isTileDeckEmpty : replaced boolean return with true for com/takenoko/engine/Board::isTileDeckEmpty → TIMED_OUT
        return gameAssets.getTileDeck().isEmpty();
338
    }
339
340
    public void applyImprovement(ImprovementType improvementType, PositionVector positionVector) {
341 1 1. applyImprovement : removed call to com/takenoko/layers/tile/TileLayer::applyImprovement → KILLED
        tileLayer.applyImprovement(improvementType, positionVector, this);
342
    }
343
344
    public void drawObjective(ObjectiveType objectiveType) {
345 1 1. drawObjective : removed call to com/takenoko/asset/ObjectiveDeck::draw → KILLED
        gameAssets.getObjectiveDeck().draw(objectiveType);
346
    }
347
348
    public Objective peekObjectiveDeck() {
349 1 1. peekObjectiveDeck : replaced return value with null for com/takenoko/engine/Board::peekObjectiveDeck → KILLED
        return gameAssets.getObjectiveDeck().peek();
350
    }
351
352
    public boolean isObjectiveDeckEmpty() {
353 2 1. isObjectiveDeckEmpty : replaced boolean return with false for com/takenoko/engine/Board::isObjectiveDeckEmpty → TIMED_OUT
2. isObjectiveDeckEmpty : replaced boolean return with true for com/takenoko/engine/Board::isObjectiveDeckEmpty → TIMED_OUT
        return gameAssets.getObjectiveDeck().isEmpty();
354
    }
355
356
    public void drawIrrigation() {
357 1 1. drawIrrigation : removed call to com/takenoko/asset/IrrigationDeck::draw → TIMED_OUT
        gameAssets.getIrrigationDeck().draw();
358
    }
359
360
    public boolean hasIrrigation() {
361 2 1. hasIrrigation : replaced boolean return with false for com/takenoko/engine/Board::hasIrrigation → TIMED_OUT
2. hasIrrigation : replaced boolean return with true for com/takenoko/engine/Board::hasIrrigation → TIMED_OUT
        return gameAssets.getIrrigationDeck().hasIrrigation();
362
    }
363
364
    public void updateAvailableIrrigationChannelPositions(PositionVector position) {
365 1 1. updateAvailableIrrigationChannelPositions : removed call to com/takenoko/layers/irrigation/IrrigationLayer::updateAvailableIrrigationChannelPositions → KILLED
        irrigationLayer.updateAvailableIrrigationChannelPositions(position, this);
366
    }
367
368
    public void placeIrrigation(EdgePosition edgePosition) {
369 1 1. placeIrrigation : removed call to com/takenoko/layers/irrigation/IrrigationLayer::placeIrrigation → KILLED
        irrigationLayer.placeIrrigation(edgePosition, this);
370
    }
371
372
    public List<EdgePosition> getAvailableIrrigationPositions() {
373 1 1. getAvailableIrrigationPositions : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getAvailableIrrigationPositions → KILLED
        return irrigationLayer.getAvailableEdgePositions().stream().toList();
374
    }
375
376
    public boolean isIrrigatedAt(PositionVector position) {
377 2 1. isIrrigatedAt : replaced boolean return with false for com/takenoko/engine/Board::isIrrigatedAt → KILLED
2. isIrrigatedAt : replaced boolean return with true for com/takenoko/engine/Board::isIrrigatedAt → KILLED
        return irrigationLayer.isIrrigatedAt(position);
378
    }
379
380
    public int getRoundNumber() {
381 1 1. getRoundNumber : replaced int return with 0 for com/takenoko/engine/Board::getRoundNumber → KILLED
        return roundNumber;
382
    }
383
384
    public void nextRound() {
385 1 1. nextRound : Replaced integer addition with subtraction → KILLED
        roundNumber++;
386
    }
387
388
    public List<PositionVector> getGrowablePositions() {
389 1 1. getGrowablePositions : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getGrowablePositions → TIMED_OUT
        return bambooLayer.getGrowablePositions(this);
390
    }
391
392
    /**
393
     * Return the list of objectives for the starting deck
394
     *
395
     * @return list of objectives
396
     */
397
    public List<Objective> getStarterDeck() {
398 1 1. getStarterDeck : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getStarterDeck → TIMED_OUT
        return gameAssets.getStarterDeck();
399
    }
400
401
    public BoardStatistics getBoardStatistics() {
402 1 1. getBoardStatistics : replaced return value with null for com/takenoko/engine/Board::getBoardStatistics → KILLED
        return boardStatistics;
403
    }
404
405
    public void analyze() {
406 1 1. analyze : removed call to com/takenoko/stats/BoardStatistics::analyzeBoard → TIMED_OUT
        boardStatistics.analyzeBoard(this);
407
    }
408
409
    public List<EdgePosition> getPlacedIrrigations() {
410 1 1. getPlacedIrrigations : replaced return value with Collections.emptyList for com/takenoko/engine/Board::getPlacedIrrigations → TIMED_OUT
        return irrigationLayer.getIrrigationChannelsPositions().stream().toList();
411
    }
412
413
    public boolean hasImprovementInDeck() {
414 2 1. hasImprovementInDeck : negated conditional → NO_COVERAGE
2. hasImprovementInDeck : replaced boolean return with true for com/takenoko/engine/Board::hasImprovementInDeck → NO_COVERAGE
        return !gameAssets.getImprovementDeck().isEmpty();
415
    }
416
417
    public boolean hasObjectiveTypeInDeck(ObjectiveType objectiveType) {
418 2 1. hasObjectiveTypeInDeck : replaced boolean return with false for com/takenoko/engine/Board::hasObjectiveTypeInDeck → KILLED
2. hasObjectiveTypeInDeck : replaced boolean return with true for com/takenoko/engine/Board::hasObjectiveTypeInDeck → KILLED
        return gameAssets.hasObjectiveTypeInDeck(objectiveType);
419
    }
420
}

Mutations

64

1.1
Location : peekWeather
Killed by : com.takenoko.bot.utils.HistoryAnalysisTest.[engine:junit-jupiter]/[class:com.takenoko.bot.utils.HistoryAnalysisTest]/[nested-class:IntegrationTest]/[method:test1()]
replaced return value with null for com/takenoko/engine/Board::peekWeather → KILLED

97

1.1
Location : getAvailableTiles
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnAListOfAvailableTiles()]
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getAvailableTiles → KILLED

106

1.1
Location : getTiles
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnAListOfTiles()]
replaced return value with Collections.emptyMap for com/takenoko/engine/Board::getTiles → KILLED

115

1.1
Location : getAvailableTilePositions
Killed by : com.takenoko.engine.GameEngineTest.[engine:junit-jupiter]/[class:com.takenoko.engine.GameEngineTest]/[nested-class:TestRunGame]/[method:runGame_shouldDisplayALotOfMessages()]
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getAvailableTilePositions → KILLED

124

1.1
Location : getTilesWithoutPond
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnAListOfTilesWithoutPond()]
replaced return value with Collections.emptyMap for com/takenoko/engine/Board::getTilesWithoutPond → KILLED

134

1.1
Location : isTile
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnTrueIfTileIsPresent()]
replaced boolean return with false for com/takenoko/engine/Board::isTile → KILLED

2.2
Location : isTile
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnTrueIfTileIsPresent()]
replaced boolean return with true for com/takenoko/engine/Board::isTile → KILLED

144

1.1
Location : getTileAt
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnATileAtAGivenPosition()]
replaced return value with null for com/takenoko/engine/Board::getTileAt → KILLED

155

1.1
Location : placeTile
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldPlaceATileAtAGivenPosition()]
replaced return value with null for com/takenoko/engine/Board::placeTile → KILLED

164

1.1
Location : getBambooAt
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnABambooAtAGivenPosition()]
replaced return value with null for com/takenoko/engine/Board::getBambooAt → KILLED

174

1.1
Location : growBamboo
Killed by : com.takenoko.bot.utils.HistoryAnalysisTest.[engine:junit-jupiter]/[class:com.takenoko.bot.utils.HistoryAnalysisTest]/[nested-class:IntegrationTest]/[method:test1()]
replaced return value with null for com/takenoko/engine/Board::growBamboo → KILLED

183

1.1
Location : eatBamboo
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldEatBambooAtAGivenPosition()]
removed call to com/takenoko/layers/bamboo/BambooLayer::eatBamboo → KILLED

193

1.1
Location : isBambooEatableAt
Killed by : none
replaced boolean return with false for com/takenoko/engine/Board::isBambooEatableAt → TIMED_OUT

2.2
Location : isBambooEatableAt
Killed by : com.takenoko.bot.utils.HistoryAnalysisTest.[engine:junit-jupiter]/[class:com.takenoko.bot.utils.HistoryAnalysisTest]/[nested-class:IntegrationTest]/[method:test1()]
replaced boolean return with true for com/takenoko/engine/Board::isBambooEatableAt → KILLED

198

1.1
Location : getPandaPosition
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnPandaPosition()]
replaced return value with null for com/takenoko/engine/Board::getPandaPosition → KILLED

203

1.1
Location : getGardenerPosition
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnGardenerPosition()]
replaced return value with null for com/takenoko/engine/Board::getGardenerPosition → KILLED

212

1.1
Location : getPandaPossibleMoves
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnPandaPossibleMoves()]
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getPandaPossibleMoves → KILLED

221

1.1
Location : getGardenerPossibleMoves
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldReturnGardenerPossibleMoves()]
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getGardenerPossibleMoves → KILLED

231

1.1
Location : movePanda
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[method:shouldMoveGardenerToAGivenPosition()]
replaced return value with Collections.emptyMap for com/takenoko/engine/Board::movePanda → KILLED

241

1.1
Location : moveGardener
Killed by : none
replaced return value with Collections.emptyMap for com/takenoko/engine/Board::moveGardener → TIMED_OUT

246

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardIsNull_ThenReturnsFalse()]
negated conditional → KILLED

2.2
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:EqualsWithItselfIsTrue()]
replaced boolean return with false for com/takenoko/engine/Board::equals → KILLED

247

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

2.2
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

3.3
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardIsNull_ThenReturnsFalse()]
replaced boolean return with true for com/takenoko/engine/Board::equals → KILLED

249

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

2.2
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreNotEqual_ThenReturnsFalse()]
replaced boolean return with true for com/takenoko/engine/Board::equals → KILLED

250

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

251

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

252

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

253

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

254

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

255

1.1
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

2.2
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

3.3
Location : equals
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestEquals]/[method:equals_WhenBoardsAreEqual_ThenReturnsTrue()]
negated conditional → KILLED

262

1.1
Location : hashCode
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestHashCode]/[method:hashCode_WhenBoardsAreNotEqual_ThenReturnsDifferentHashCode()]
replaced int return with 0 for com/takenoko/engine/Board::hashCode → KILLED

275

1.1
Location : copy
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestCopy]/[method:copy_WhenBoardIsCopied_ThenReturnsNewBoard()]
replaced return value with null for com/takenoko/engine/Board::copy → KILLED

279

1.1
Location : getWeather
Killed by : none
replaced return value with Optional.empty for com/takenoko/engine/Board::getWeather → TIMED_OUT

292

1.1
Location : isBambooGrowableAt
Killed by : com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest.[engine:junit-jupiter]/[class:com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest]/[nested-class:GetIrrigationToPlace]/[method:integrationTestForIrrigationPathFinding()]
replaced boolean return with false for com/takenoko/engine/Board::isBambooGrowableAt → KILLED

2.2
Location : isBambooGrowableAt
Killed by : none
replaced boolean return with true for com/takenoko/engine/Board::isBambooGrowableAt → TIMED_OUT

300

1.1
Location : drawImprovement
Killed by : none
replaced return value with null for com/takenoko/engine/Board::drawImprovement → TIMED_OUT

309

1.1
Location : peekImprovement
Killed by : none
replaced return value with null for com/takenoko/engine/Board::peekImprovement → TIMED_OUT

317

1.1
Location : hasImprovementInDeck
Killed by : none
replaced boolean return with false for com/takenoko/engine/Board::hasImprovementInDeck → TIMED_OUT

2.2
Location : hasImprovementInDeck
Killed by : none
replaced boolean return with true for com/takenoko/engine/Board::hasImprovementInDeck → TIMED_OUT

321

1.1
Location : getAvailableImprovementPositions
Killed by : none
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getAvailableImprovementPositions → TIMED_OUT

325

1.1
Location : drawTiles
Killed by : com.takenoko.layers.irrigation.IrrigationLayerTest.[engine:junit-jupiter]/[class:com.takenoko.layers.irrigation.IrrigationLayerTest]/[nested-class:TestPlaceIrrigation]/[method:placeIrrigationShouldUpdateIrrigationMap()]
removed call to com/takenoko/asset/TileDeck::draw → KILLED

329

1.1
Location : peekTileDeck
Killed by : com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest.[engine:junit-jupiter]/[class:com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest]/[nested-class:GetIrrigationToPlace]/[method:integrationTestForIrrigationPathFinding()]
replaced return value with Collections.emptyList for com/takenoko/engine/Board::peekTileDeck → KILLED

333

1.1
Location : chooseTileInTileDeck
Killed by : none
removed call to com/takenoko/asset/TileDeck::choose → TIMED_OUT

337

1.1
Location : isTileDeckEmpty
Killed by : none
replaced boolean return with false for com/takenoko/engine/Board::isTileDeckEmpty → TIMED_OUT

2.2
Location : isTileDeckEmpty
Killed by : none
replaced boolean return with true for com/takenoko/engine/Board::isTileDeckEmpty → TIMED_OUT

341

1.1
Location : applyImprovement
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestApplyImprovement]/[method:applyImprovement_WhenImprovementIsApplied_CallsApplyImprovementOnTileLayer()]
removed call to com/takenoko/layers/tile/TileLayer::applyImprovement → KILLED

345

1.1
Location : drawObjective
Killed by : com.takenoko.bot.utils.HistoryAnalysisTest.[engine:junit-jupiter]/[class:com.takenoko.bot.utils.HistoryAnalysisTest]/[nested-class:IntegrationTest]/[method:test1()]
removed call to com/takenoko/asset/ObjectiveDeck::draw → KILLED

349

1.1
Location : peekObjectiveDeck
Killed by : com.takenoko.engine.GameEngineTest.[engine:junit-jupiter]/[class:com.takenoko.engine.GameEngineTest]/[nested-class:TestRunGame]/[method:runGame_shouldDisplayALotOfMessages()]
replaced return value with null for com/takenoko/engine/Board::peekObjectiveDeck → KILLED

353

1.1
Location : isObjectiveDeckEmpty
Killed by : none
replaced boolean return with false for com/takenoko/engine/Board::isObjectiveDeckEmpty → TIMED_OUT

2.2
Location : isObjectiveDeckEmpty
Killed by : none
replaced boolean return with true for com/takenoko/engine/Board::isObjectiveDeckEmpty → TIMED_OUT

357

1.1
Location : drawIrrigation
Killed by : none
removed call to com/takenoko/asset/IrrigationDeck::draw → TIMED_OUT

361

1.1
Location : hasIrrigation
Killed by : none
replaced boolean return with false for com/takenoko/engine/Board::hasIrrigation → TIMED_OUT

2.2
Location : hasIrrigation
Killed by : none
replaced boolean return with true for com/takenoko/engine/Board::hasIrrigation → TIMED_OUT

365

1.1
Location : updateAvailableIrrigationChannelPositions
Killed by : com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest.[engine:junit-jupiter]/[class:com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest]/[nested-class:GetIrrigationToPlace]/[method:integrationTestForIrrigationPathFinding()]
removed call to com/takenoko/layers/irrigation/IrrigationLayer::updateAvailableIrrigationChannelPositions → KILLED

369

1.1
Location : placeIrrigation
Killed by : com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest.[engine:junit-jupiter]/[class:com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest]/[nested-class:GetIrrigationToPlace]/[method:integrationTestForIrrigationPathFinding()]
removed call to com/takenoko/layers/irrigation/IrrigationLayer::placeIrrigation → KILLED

373

1.1
Location : getAvailableIrrigationPositions
Killed by : com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest.[engine:junit-jupiter]/[class:com.takenoko.bot.irrigation.pathfinding.IrrigationPathFindingTest]/[nested-class:GetIrrigationToPlace]/[method:integrationTestForIrrigationPathFinding()]
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getAvailableIrrigationPositions → KILLED

377

1.1
Location : isIrrigatedAt
Killed by : com.takenoko.engine.BoardStatisticsTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardStatisticsTest]/[nested-class:TestAnalyzeBoard]/[method:GeneralTests()]
replaced boolean return with false for com/takenoko/engine/Board::isIrrigatedAt → KILLED

2.2
Location : isIrrigatedAt
Killed by : com.takenoko.engine.BoardStatisticsTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardStatisticsTest]/[nested-class:TestAnalyzeBoard]/[method:GeneralTests()]
replaced boolean return with true for com/takenoko/engine/Board::isIrrigatedAt → KILLED

381

1.1
Location : getRoundNumber
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestNextRound]/[method:nextRound_WhenNextRoundIsCalled_RoundNumberIsIncremented()]
replaced int return with 0 for com/takenoko/engine/Board::getRoundNumber → KILLED

385

1.1
Location : nextRound
Killed by : com.takenoko.engine.BoardTest.[engine:junit-jupiter]/[class:com.takenoko.engine.BoardTest]/[nested-class:TestNextRound]/[method:nextRound_WhenNextRoundIsCalled_RoundNumberIsIncremented()]
Replaced integer addition with subtraction → KILLED

389

1.1
Location : getGrowablePositions
Killed by : none
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getGrowablePositions → TIMED_OUT

398

1.1
Location : getStarterDeck
Killed by : none
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getStarterDeck → TIMED_OUT

402

1.1
Location : getBoardStatistics
Killed by : com.takenoko.engine.GameEngineTest.[engine:junit-jupiter]/[class:com.takenoko.engine.GameEngineTest]/[nested-class:TestEndGame]/[method:endGame_shouldIncrementsVictoriesAndLossesAndUpdateScores()]
replaced return value with null for com/takenoko/engine/Board::getBoardStatistics → KILLED

406

1.1
Location : analyze
Killed by : none
removed call to com/takenoko/stats/BoardStatistics::analyzeBoard → TIMED_OUT

410

1.1
Location : getPlacedIrrigations
Killed by : none
replaced return value with Collections.emptyList for com/takenoko/engine/Board::getPlacedIrrigations → TIMED_OUT

414

1.1
Location : hasImprovementInDeck
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : hasImprovementInDeck
Killed by : none
replaced boolean return with true for com/takenoko/engine/Board::hasImprovementInDeck → NO_COVERAGE

418

1.1
Location : hasObjectiveTypeInDeck
Killed by : com.takenoko.bot.ColletBotTest.[engine:junit-jupiter]/[class:com.takenoko.bot.ColletBotTest]/[nested-class:IntegrationTests]/[method:whenTheBotChoosesAnObjectiveItTakesThePandaOnesIfThereAreSomeAvailables()]
replaced boolean return with false for com/takenoko/engine/Board::hasObjectiveTypeInDeck → KILLED

2.2
Location : hasObjectiveTypeInDeck
Killed by : com.takenoko.bot.utils.HistoryAnalysisTest.[engine:junit-jupiter]/[class:com.takenoko.bot.utils.HistoryAnalysisTest]/[nested-class:IntegrationTest]/[method:test1()]
replaced boolean return with true for com/takenoko/engine/Board::hasObjectiveTypeInDeck → KILLED

Active mutators

Tests examined


Report generated by PIT 1.8.0