blob: ed83a9e296b9829d6cc1c9d39e7b45aeacc399c3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package design.model.statistics;
import java.util.Arrays;
import design.model.Round;
public abstract class StatisticsDecorator implements Statistics{
protected Statistics wrapped_statistics;
public StatisticsDecorator(Statistics wrapped_statistics){
this.wrapped_statistics = wrapped_statistics;
}
@Override
public Round[] getRounds() {
return wrapped_statistics.getRounds();
}
@Override
public int get_score() {
return Arrays.stream(getRounds()).mapToInt(Round::getTotalSwings).sum();
}
@Override
public double get_distance() {
return Arrays.stream(getRounds()).mapToDouble(Round::getTotalDistance).sum();
}
}
|