Skip to content

Commit 8faf2dc

Browse files
committed
Add the initial glicko history point with the old elo of the first TeamGlickoHistory row
1 parent 97f4dc1 commit 8faf2dc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/java/org/bytefight/webserver/glicko/domain/dto/TeamGlickoHistoryDto.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public static TeamGlickoHistoryDto from(
2525
List<Long> timestamps = new ArrayList<>(histories.size());
2626
List<Double> glickos = new ArrayList<>(histories.size());
2727

28+
if(!histories.isEmpty()) {
29+
TeamGlickoHistory initial = histories.get(0);
30+
timestamps.add(team.getCreatedAt().getEpochSecond());
31+
glickos.add(initial.getOldGlicko());
32+
}
33+
2834
for (TeamGlickoHistory h : histories) {
2935
timestamps.add(h.getCreatedAt().getEpochSecond());
3036
glickos.add(h.getNewGlicko());

0 commit comments

Comments
 (0)