1 | package com.takenoko.stats; | |
2 | ||
3 | import com.takenoko.bot.utils.GameProgress; | |
4 | import com.takenoko.bot.utils.HistoryAnalysis; | |
5 | import com.takenoko.engine.History; | |
6 | import java.util.HashMap; | |
7 | import java.util.UUID; | |
8 | ||
9 | public class HistoryStatisticsItem extends HashMap<GameProgress, GameProgressStatistics> { | |
10 | ||
11 | public HistoryStatisticsItem() { | |
12 | super(); | |
13 | this.put(GameProgress.EARLY_GAME, new GameProgressStatistics(GameProgress.EARLY_GAME)); | |
14 | this.put(GameProgress.MID_GAME, new GameProgressStatistics(GameProgress.MID_GAME)); | |
15 | this.put(GameProgress.LATE_GAME, new GameProgressStatistics(GameProgress.LATE_GAME)); | |
16 | } | |
17 | ||
18 | @Override | |
19 | public String toString() { | |
20 | StringBuilder fullGameProgress = new StringBuilder(); | |
21 | fullGameProgress | |
22 | .append(get(GameProgress.EARLY_GAME)) | |
23 | .append("\n") | |
24 | .append(get(GameProgress.MID_GAME)) | |
25 | .append("\n") | |
26 | .append(get(GameProgress.LATE_GAME)) | |
27 | .append("\n"); | |
28 |
1
1. toString : replaced return value with "" for com/takenoko/stats/HistoryStatisticsItem::toString → TIMED_OUT |
return fullGameProgress.toString(); |
29 | } | |
30 | ||
31 | public void updateEvolution(History history, UUID uniqueID) { | |
32 | get(HistoryAnalysis.getGameProgress(history)) | |
33 |
2
1. updateEvolution : removed call to com/takenoko/stats/GameProgressStatistics::update → TIMED_OUT 2. updateEvolution : Replaced integer subtraction with addition → KILLED |
.update(history.get(uniqueID).get(history.get(uniqueID).size() - 1)); |
34 | } | |
35 | } | |
Mutations | ||
28 |
1.1 |
|
33 |
1.1 2.2 |